Oleksandr Kozachenko | b009349 | 2023-09-06 21:43:47 +0200 | [diff] [blame] | 1 | {{- /* |
| 2 | Copyright VMware, Inc. |
| 3 | SPDX-License-Identifier: APACHE-2.0 |
| 4 | */}} |
| 5 | |
| 6 | {{- if .Values.ingress.enabled }} |
| 7 | apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} |
| 8 | kind: Ingress |
| 9 | metadata: |
| 10 | name: {{ include "common.names.fullname" . }} |
| 11 | namespace: {{ include "common.names.namespace" . | quote }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 12 | {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.ingress.labels .Values.commonLabels ) "context" . ) }} |
| 13 | labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} |
Oleksandr Kozachenko | b009349 | 2023-09-06 21:43:47 +0200 | [diff] [blame] | 14 | app.kubernetes.io/component: keycloak |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 15 | {{- if or .Values.ingress.annotations .Values.commonAnnotations }} |
| 16 | {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.ingress.annotations .Values.commonAnnotations ) "context" . ) }} |
| 17 | annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} |
| 18 | {{- end }} |
Oleksandr Kozachenko | b009349 | 2023-09-06 21:43:47 +0200 | [diff] [blame] | 19 | spec: |
| 20 | {{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }} |
| 21 | ingressClassName: {{ .Values.ingress.ingressClassName | quote }} |
| 22 | {{- end }} |
| 23 | rules: |
| 24 | {{- if .Values.ingress.hostname }} |
| 25 | - host: {{ (tpl .Values.ingress.hostname .) | quote }} |
| 26 | http: |
| 27 | paths: |
| 28 | {{- if .Values.ingress.extraPaths }} |
| 29 | {{- toYaml .Values.ingress.extraPaths | nindent 10 }} |
| 30 | {{- end }} |
| 31 | - path: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.path "context" $) }} |
| 32 | {{- if eq "true" (include "common.ingress.supportsPathType" .) }} |
| 33 | pathType: {{ .Values.ingress.pathType }} |
| 34 | {{- end }} |
| 35 | backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" .Values.ingress.servicePort "context" $) | nindent 14 }} |
| 36 | {{- end }} |
| 37 | {{- range .Values.ingress.extraHosts }} |
| 38 | - host: {{ (tpl .name $) }} |
| 39 | http: |
| 40 | paths: |
| 41 | - path: {{ default "/" .path }} |
| 42 | {{- if eq "true" (include "common.ingress.supportsPathType" $) }} |
| 43 | pathType: {{ default "ImplementationSpecific" .pathType }} |
| 44 | {{- end }} |
| 45 | backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" $.Values.ingress.servicePort "context" $) | nindent 14 }} |
| 46 | {{- end }} |
| 47 | {{- if .Values.ingress.extraRules }} |
| 48 | {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }} |
| 49 | {{- end }} |
| 50 | {{- if or (and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned .Values.ingress.secrets )) .Values.ingress.extraTls }} |
| 51 | tls: |
| 52 | {{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.secrets .Values.ingress.selfSigned) }} |
| 53 | - hosts: |
| 54 | - {{ (tpl .Values.ingress.hostname .) | quote }} |
| 55 | secretName: {{ printf "%s-tls" (tpl .Values.ingress.hostname .) }} |
| 56 | {{- end }} |
| 57 | {{- if .Values.ingress.extraTls }} |
| 58 | {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }} |
| 59 | {{- end }} |
| 60 | {{- end }} |
| 61 | {{- end }} |