Ingress: make tls functions gotpl yaml safe
This PS updates the tls functions to be yaml safe for the service name. Change-Id: I535f38a8d92c01280d79926a1f0acd06984aabbf Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
parent
469fe37c3e
commit
326303702d
@ -67,12 +67,12 @@ metadata:
|
|||||||
kubernetes.io/ingress.class: {{ index $envAll.Values.network $backendService "ingress" "classes" $ingressController | quote }}
|
kubernetes.io/ingress.class: {{ index $envAll.Values.network $backendService "ingress" "classes" $ingressController | quote }}
|
||||||
{{ toYaml (index $envAll.Values.network $backendService "ingress" "annotations") | indent 4 }}
|
{{ toYaml (index $envAll.Values.network $backendService "ingress" "annotations") | indent 4 }}
|
||||||
spec:
|
spec:
|
||||||
{{- $host := index $envAll.Values.endpoints $backendServiceType "host_fqdn_override" }}
|
{{- $host := index $envAll.Values.endpoints ( $backendServiceType | replace "-" "_" ) "host_fqdn_override" }}
|
||||||
{{- if $host.public }}
|
{{- if $host.public }}
|
||||||
{{- if $host.public.tls }}
|
{{- if $host.public.tls }}
|
||||||
{{- if and $host.public.tls.key $host.public.tls.crt }}
|
{{- if and $host.public.tls.key $host.public.tls.crt }}
|
||||||
tls:
|
tls:
|
||||||
- secretName: {{ index $envAll.Values.secrets "tls" $backendServiceType $backendService "public" }}
|
- secretName: {{ index $envAll.Values.secrets "tls" ( $backendServiceType | replace "-" "_" ) $backendService "public" }}
|
||||||
hosts:
|
hosts:
|
||||||
- {{ index $hostNameFullRules "vHost" }}
|
- {{ index $hostNameFullRules "vHost" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
{{- $endpoint := index . "endpoint" | default "public" }}
|
{{- $endpoint := index . "endpoint" | default "public" }}
|
||||||
{{- $backendServiceType := index . "backendServiceType" }}
|
{{- $backendServiceType := index . "backendServiceType" }}
|
||||||
{{- $backendService := index . "backendService" | default "api" }}
|
{{- $backendService := index . "backendService" | default "api" }}
|
||||||
{{- $host := index $envAll.Values.endpoints $backendServiceType "host_fqdn_override" }}
|
{{- $host := index $envAll.Values.endpoints ( $backendServiceType | replace "-" "_" ) "host_fqdn_override" }}
|
||||||
{{- if $host.public }}
|
{{- if $host.public }}
|
||||||
{{- if $host.public.tls }}
|
{{- if $host.public.tls }}
|
||||||
{{- if and $host.public.tls.key $host.public.tls.crt }}
|
{{- if and $host.public.tls.key $host.public.tls.crt }}
|
||||||
@ -27,7 +27,7 @@ limitations under the License.
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ index $envAll.Values.secrets.tls $backendServiceType $backendService $endpoint }}
|
name: {{ index $envAll.Values.secrets.tls ( $backendServiceType | replace "-" "_" ) $backendService $endpoint }}
|
||||||
type: kubernetes.io/tls
|
type: kubernetes.io/tls
|
||||||
data:
|
data:
|
||||||
tls.crt: {{ $host.public.tls.crt | b64enc }}
|
tls.crt: {{ $host.public.tls.crt | b64enc }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user