Browse Source

Implemented SSL redirect in AWS ALB

master
Fábio Kaiser Rauber 4 years ago
parent
commit
b550ff8879
  1. 7
      charts/portalmodelo/v0.5.0/templates/ingress.yaml

7
charts/portalmodelo/v0.5.0/templates/ingress.yaml

@ -24,6 +24,7 @@ metadata:
{{- end }} {{- end }}
{{- if contains "alb" .Values.ingress.class }} {{- if contains "alb" .Values.ingress.class }}
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]' alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
{{- end }} {{- end }}
{{- else }} {{- else }}
# DO NOT USE TLS # DO NOT USE TLS
@ -52,6 +53,12 @@ spec:
- host: "{{ $hostPrefix }}.{{ $hostName }}" - host: "{{ $hostPrefix }}.{{ $hostName }}"
http: http:
paths: paths:
{{- if and (contains "alb" .Values.ingress.class) (.Values.ingress.tls.enabled) }}
- path: /*
backend:
serviceName: ssl-redirect
servicePort: use-annotation
{{- end }}
{{- if contains "nginx" .Values.ingress.class }} {{- if contains "nginx" .Values.ingress.class }}
- path: /(.*) - path: /(.*)
{{- else }} {{- else }}

Loading…
Cancel
Save