2021-08-25 13:58:55 +00:00
|
|
|
{{- 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 }}
|
2021-08-25 13:58:55 +00:00
|
|
|
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 }}
|
2022-04-21 11:57:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
{{- define "gatewayName" -}}
|
|
|
|
{{ .Values.gateway.name | default .Release.Name | default "istio-ingressgateway" }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
|
|
|
|
{{- define "gatewaySelectorLabels" -}}
|
|
|
|
app: {{ include "gatewayName" . }}
|
|
|
|
istio: {{ include "gatewayName" . | trimPrefix "istio-" }}
|
|
|
|
{{- end }}
|