UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects

add conditional for https redirects and use hosts instead of wildcard

Files
4
@@ -13,13 +13,21 @@ spec:
selector:
{{- $values.selector | default (dict) | toYaml | nindent 4 }}
servers:
{{- if (dig "autoHttpRedirect" "enabled" true $values) }}
- hosts:
- "*"
{{- range $servers := $values.servers }}
{{- range $host := $servers.hosts }}
{{- if eq $servers.port.protocol "HTTPS" }}
- '{{- tpl $host $ }}'
{{- end }}
{{- end }}
{{- end }}
port:
name: http
number: 8080
protocol: HTTP
tls:
httpsRedirect: true
{{- end }}
{{- tpl (toYaml $values.servers) $ | nindent 2 }}
{{- end }}
\ No newline at end of file
Loading