Skip to content

Commit 7e42150

Browse files
kishorjTimothy-Dougherty
authored andcommitted
update ssl redirect documentation (kubernetes-sigs#2274)
1 parent 32d6b1b commit 7e42150

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

docs/guide/tasks/ssl_redirect.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Redirect Traffic from HTTP to HTTPS
22

3-
We'll use the [`alb.ingress.kubernetes.io/actions.${action-name}`](../ingress/annotations.md#actions) annotation to setup an ingress to redirect http traffic into https
3+
You can use the [`alb.ingress.kubernetes.io/ssl-redirect`](../ingress/annotations.md#ssl-redirect) annotation to setup an ingress to redirect http traffic to https
44

55

66
## Example Ingress Manifest
@@ -14,20 +14,18 @@ metadata:
1414
kubernetes.io/ingress.class: alb
1515
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:xxxx:certificate/xxxxxx
1616
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
17-
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
17+
alb.ingress.kubernetes.io/ssl-redirect: '443'
1818
spec:
1919
rules:
2020
- http:
2121
paths:
22-
- path: /*
23-
backend:
24-
serviceName: ssl-redirect
25-
servicePort: use-annotation
2622
- path: /users/*
23+
pathType: ImplementationSpecific
2724
backend:
2825
serviceName: user-service
2926
servicePort: 80
3027
- path: /*
28+
pathType: ImplementationSpecific
3129
backend:
3230
serviceName: default-service
3331
servicePort: 80
@@ -36,11 +34,9 @@ spec:
3634
!!!note
3735
- `alb.ingress.kubernetes.io/listen-ports` annotation must at least include [{"HTTP": 80}, {"HTTPS":443}] to listen on 80 and 443.
3836
- `alb.ingress.kubernetes.io/certificate-arn` annotation must be set to allow listen for HTTPS traffic
39-
- the `ssl-redirect` action must be be first rule(which will be evaluated first by ALB)
37+
- the ssl-redirect port must appear in the listen-port annotation, and must be an HTTPS port
4038

4139
## How it works
42-
By default, all rules specified in ingress spec will be applied to all listeners(one listener per port) on ALB.
43-
44-
If there is an redirection rule, the AWS Load Balancer controller will check it against every listener(port) to see whether it will introduce infinite redirection loop, and **will ignore that rule for specific listener.**
40+
If you enable SSL redirection, the controller configures each HTTP listener with a default action to redirect to HTTPS. The controller does not add any other rules to the HTTP listener.
4541

46-
So for our above example, the rule by `ssl-redirect` will only been applied to http(80) listener.
42+
For the above example, the HTTP listener on port 80 will have a single default rule to redirect traffic to HTTPS on port 443.

0 commit comments

Comments
 (0)