blob: 81d88b1afe3612a8c0a4becfdca15ec97ce83be4 [file] [log] [blame]
Oleksandr Kozachenkob0093492023-09-06 21:43:47 +02001{{- /*
2Copyright VMware, Inc.
3SPDX-License-Identifier: APACHE-2.0
4*/}}
5
6{{- if .Values.ingress.enabled }}
7apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
8kind: Ingress
9metadata:
10 name: {{ include "common.names.fullname" . }}
11 namespace: {{ include "common.names.namespace" . | quote }}
Mohammed Naser65cda132024-05-02 14:34:08 -040012 {{- $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 Kozachenkob0093492023-09-06 21:43:47 +020014 app.kubernetes.io/component: keycloak
Mohammed Naser65cda132024-05-02 14:34:08 -040015 {{- 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 Kozachenkob0093492023-09-06 21:43:47 +020019spec:
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 }}