blob: 3ba331ddcbf8a45540a18166ddbd5dfb214fa083 [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 }}
12 labels: {{- include "common.labels.standard" . | nindent 4 }}
13 app.kubernetes.io/component: keycloak
14 {{- if .Values.commonLabels }}
15 {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
16 {{- end }}
17 {{- if .Values.ingress.labels }}
18 {{- include "common.tplvalues.render" ( dict "value" .Values.ingress.labels "context" $ ) | nindent 4 }}
19 {{- end }}
20 annotations:
21 {{- if .Values.commonAnnotations }}
22 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
23 {{- end }}
24 {{- if .Values.ingress.annotations }}
25 {{- include "common.tplvalues.render" (dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
26 {{- end }}
27spec:
28 {{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
29 ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
30 {{- end }}
31 rules:
32 {{- if .Values.ingress.hostname }}
33 - host: {{ (tpl .Values.ingress.hostname .) | quote }}
34 http:
35 paths:
36 {{- if .Values.ingress.extraPaths }}
37 {{- toYaml .Values.ingress.extraPaths | nindent 10 }}
38 {{- end }}
39 - path: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.path "context" $) }}
40 {{- if eq "true" (include "common.ingress.supportsPathType" .) }}
41 pathType: {{ .Values.ingress.pathType }}
42 {{- end }}
43 backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" .Values.ingress.servicePort "context" $) | nindent 14 }}
44 {{- end }}
45 {{- range .Values.ingress.extraHosts }}
46 - host: {{ (tpl .name $) }}
47 http:
48 paths:
49 - path: {{ default "/" .path }}
50 {{- if eq "true" (include "common.ingress.supportsPathType" $) }}
51 pathType: {{ default "ImplementationSpecific" .pathType }}
52 {{- end }}
53 backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" $.Values.ingress.servicePort "context" $) | nindent 14 }}
54 {{- end }}
55 {{- if .Values.ingress.extraRules }}
56 {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }}
57 {{- end }}
58 {{- 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 }}
59 tls:
60 {{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.secrets .Values.ingress.selfSigned) }}
61 - hosts:
62 - {{ (tpl .Values.ingress.hostname .) | quote }}
63 secretName: {{ printf "%s-tls" (tpl .Values.ingress.hostname .) }}
64 {{- end }}
65 {{- if .Values.ingress.extraTls }}
66 {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }}
67 {{- end }}
68 {{- end }}
69{{- end }}