KubeZero/charts/kubezero-istio-gateway/templates/_gateway.tpl

54 lines
1.2 KiB
Smarty
Raw Permalink Normal View History

{{- define "gatewayServers" }}
{{- range $port := .ports }}
{{- if not $port.noGateway }}
{{- $eachCert := false }}
{{- if $port.tls }}
{{- if not $port.tls.httpsRedirect }}
{{- $eachCert = true }}
{{- end }}
{{- end }}
{{- if $eachCert }}
{{- range $cert := $.certificates }}
- port:
number: {{ $port.port }}
2021-09-03 17:19:48 +00:00
name: {{ $port.name }}-{{ $cert.name }}
protocol: {{ default "TCP" $port.gatewayProtocol }}
tls:
credentialName: {{ $cert.name }}
{{- toYaml $port.tls | nindent 4 }}
hosts:
{{- toYaml $cert.dnsNames | nindent 2 }}
{{- end }}
{{- else }}
- port:
number: {{ $port.port }}
name: {{ $port.name }}
protocol: {{ default "TCP" $port.gatewayProtocol }}
{{- with $port.tls }}
tls:
{{- toYaml . | nindent 4 }}
{{- end }}
hosts:
{{- range $cert := $.certificates }}
{{- toYaml $cert.dnsNames | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- define "gatewayName" -}}
{{ .Values.gateway.name | default .Release.Name | default "istio-ingressgateway" }}
{{- end }}
{{- define "gatewaySelectorLabels" -}}
app: {{ include "gatewayName" . }}
istio: {{ include "gatewayName" . | trimPrefix "istio-" }}
{{- end }}