51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
{{- if .Values.gateway.enabled }}
|
|
apiVersion: gateway.networking.k8s.io/v1
|
|
kind: Gateway
|
|
metadata:
|
|
name: {{ include "movienight.gatewayName" . }}
|
|
labels:
|
|
{{- include "movienight.componentLabels" (dict "root" . "component" "gateway") | nindent 4 }}
|
|
{{- with .Values.gateway.labels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- if or .Values.global.annotations .Values.gateway.annotations }}
|
|
annotations:
|
|
{{- with .Values.global.annotations }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- with .Values.gateway.annotations }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
gatewayClassName: {{ required "gateway.className is required when gateway.enabled=true" .Values.gateway.className | quote }}
|
|
listeners:
|
|
{{- if .Values.gateway.http.enabled }}
|
|
- name: http
|
|
protocol: HTTP
|
|
port: {{ .Values.gateway.http.port }}
|
|
{{- if .Values.gateway.listenerHostname }}
|
|
hostname: {{ .Values.gateway.listenerHostname | quote }}
|
|
{{- end }}
|
|
allowedRoutes:
|
|
namespaces:
|
|
from: Same
|
|
{{- end }}
|
|
{{- if .Values.gateway.https.enabled }}
|
|
- name: https
|
|
protocol: HTTPS
|
|
port: {{ .Values.gateway.https.port }}
|
|
{{- if .Values.gateway.listenerHostname }}
|
|
hostname: {{ .Values.gateway.listenerHostname | quote }}
|
|
{{- end }}
|
|
tls:
|
|
mode: Terminate
|
|
certificateRefs:
|
|
- kind: Secret
|
|
name: {{ required "gateway.https.secretName is required when gateway.https.enabled=true" .Values.gateway.https.secretName }}
|
|
allowedRoutes:
|
|
namespaces:
|
|
from: Same
|
|
{{- end }}
|
|
{{- end }}
|