refactor: simplify tls handling by always redirecting
This commit is contained in:
1 parent
541eb1a1bc
commit
bfccf60a37
4 files changed
+18
-22
No files matched your search
@@ -26,16 +26,15 @@ metadata:
|
||||
namespace: {{ $.Values.global.namespace }}
|
||||
spec:
|
||||
entryPoints:
|
||||
{{- if and $config.web.tls.enabled (eq $port_map.scheme "https") }}
|
||||
{{- if $config.web.tls.enabled }}
|
||||
- websecure
|
||||
{{- else }}
|
||||
- web
|
||||
{{- end }}
|
||||
- web
|
||||
routes:
|
||||
{{- range $ddx, $domain := $config.web.domains }}
|
||||
- kind: Rule
|
||||
match: Host(`{{ $domain }}`)
|
||||
{{- if and $config.web.tls.enabled (and (eq $port_map.scheme "http") $port_map.redirect_to_https) }}
|
||||
{{- if $config.web.tls.enabled }}
|
||||
middlewares:
|
||||
- name: {{ $.Values.global.app_name}}-{{ $processName }}-redirect-to-https
|
||||
namespace: {{ $.Values.global.namespace }}
|
||||
@@ -47,7 +46,7 @@ spec:
|
||||
port: {{ $port_map.name }}
|
||||
scheme: http
|
||||
{{- end }}
|
||||
{{- if and $config.web.tls.enabled (eq $port_map.scheme "https") }}
|
||||
{{- if $config.web.tls.enabled }}
|
||||
tls:
|
||||
secretName: tls-{{ $.Values.global.app_name }}-{{ $processName }}
|
||||
{{- end }}
|
||||
|
||||
@@ -18,6 +18,9 @@ metadata:
|
||||
{{ $k }}: {{ $v | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $config.web.tls.enabled }}
|
||||
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
|
||||
{{- end }}
|
||||
labels:
|
||||
app.kubernetes.io/instance: {{ $.Values.global.app_name }}-{{ $processName }}
|
||||
app.kubernetes.io/name: {{ $processName }}
|
||||
@@ -26,7 +29,7 @@ metadata:
|
||||
namespace: {{ $.Values.global.namespace }}
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
{{- if and $config.web.tls.enabled (eq $port_map.scheme "https") }}
|
||||
{{- if $config.web.tls.enabled }}
|
||||
tls:
|
||||
- hosts:
|
||||
{{- range $ddx, $domain := $config.web.domains }}
|
||||
|
||||
Reference in new issue
Block a user