|
| 1 | +{{- if index .Values "gateway-api" "enabled" -}} |
| 2 | + |
| 3 | +{{- $fullName := include "flex-all-in-one.fullname" . -}} |
| 4 | +{{- $namespace := .Release.Namespace -}} |
| 5 | + |
| 6 | +apiVersion: gateway.networking.k8s.io/v1 |
| 7 | +kind: Gateway |
| 8 | +metadata: |
| 9 | + name: {{ index .Values "gateway-api" "gateway" "name" }} |
| 10 | + namespace: {{ $namespace }} |
| 11 | + labels: |
| 12 | + app: {{ $fullName }}-gateway |
| 13 | + {{- if index .Values "gateway-api" "gateway" "labels" }} |
| 14 | + {{- toYaml (index .Values "gateway-api" "gateway" "labels") | nindent 4 }} |
| 15 | + {{- end }} |
| 16 | + {{- if index .Values "gateway-api" "gateway" "annotations" }} |
| 17 | + annotations: |
| 18 | + {{- toYaml (index .Values "gateway-api" "gateway" "annotations") | nindent 4 }} |
| 19 | + {{- end }} |
| 20 | +spec: |
| 21 | + gatewayClassName: {{ index .Values "gateway-api" "gateway" "className" }} |
| 22 | + infrastructure: |
| 23 | + labels: |
| 24 | + app: {{ $fullName }}-gateway-infrastructure |
| 25 | + {{- if index .Values "gateway-api" "gateway" "infrastructure" "labels" }} |
| 26 | + {{- toYaml (index .Values "gateway-api" "gateway" "infrastructure" "labels") | nindent 6 }} |
| 27 | + {{- end }} |
| 28 | + {{- if index .Values "gateway-api" "gateway" "infrastructure" "annotations" }} |
| 29 | + annotations: |
| 30 | + {{- toYaml (index .Values "gateway-api" "gateway" "infrastructure" "annotations") | nindent 6 }} |
| 31 | + {{- end }} |
| 32 | + {{- if index .Values "gateway-api" "gateway" "infrastructure" "parametersRef" }} |
| 33 | + parametersRef: |
| 34 | + {{- toYaml (index .Values "gateway-api" "gateway" "infrastructure" "parametersRef") | nindent 6 }} |
| 35 | + {{- else if and (eq (index .Values "gateway-api" "gateway" "className") "airlock-microgateway") (index .Values "gateway-api" "additionalConfig" "airlock" "createLbService") }} |
| 36 | + parametersRef: |
| 37 | + group: microgateway.airlock.com |
| 38 | + kind: GatewayParameters |
| 39 | + name: {{ .Release.Name }}-airlock-gw-params |
| 40 | + {{- else if and (eq (index .Values "gateway-api" "gateway" "className") "nginx") (index .Values "gateway-api" "gateway" "caCert") }} |
| 41 | + parametersRef: |
| 42 | + group: gateway.nginx.org |
| 43 | + kind: NginxProxy |
| 44 | + name: {{ .Release.Name }}-nginx-proxy-config |
| 45 | + {{- end }} |
| 46 | + {{- if and (index .Values "gateway-api" "gateway" "attachLbIp") (.Values.lbIp) }} |
| 47 | + addresses: |
| 48 | + - type: IPAddress |
| 49 | + value: {{ .Values.lbIp }} |
| 50 | + {{- end }} |
| 51 | + listeners: |
| 52 | + - name: http |
| 53 | + port: {{ index .Values "gateway-api" "gateway" "httpPort" }} |
| 54 | + protocol: HTTP |
| 55 | + - name: https |
| 56 | + port: {{ index .Values "gateway-api" "gateway" "httpsPort" }} |
| 57 | + protocol: HTTPS |
| 58 | + tls: |
| 59 | + mode: Terminate |
| 60 | + certificateRefs: |
| 61 | + - name: {{ index .Values "gateway-api" "gateway" "tlsSecretName" }} |
| 62 | + |
| 63 | +{{- end }} |
0 commit comments