blob: 1869ecf7c6880e03fd06e00495fe622936eafc2f [file] [log] [blame]
Mohammed Naser65cda132024-05-02 14:34:08 -04001{{- /*
Mohammed Naser7d1623e2024-06-17 09:12:39 -04002Copyright Broadcom, Inc. All Rights Reserved.
Mohammed Naser65cda132024-05-02 14:34:08 -04003SPDX-License-Identifier: APACHE-2.0
4*/}}
5
6{{- if .Values.adminIngress.enabled }}
7apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
8kind: Ingress
9metadata:
10 name: {{ include "common.names.fullname" . }}-admin
11 namespace: {{ include "common.names.namespace" . | quote }}
12 {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.adminIngress.labels .Values.commonLabels ) "context" . ) }}
13 labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
14 app.kubernetes.io/component: keycloak
15 {{- if or .Values.adminIngress.annotations .Values.commonAnnotations }}
16 {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.adminIngress.annotations .Values.commonAnnotations ) "context" . ) }}
17 annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
18 {{- end }}
19spec:
20 {{- if and .Values.adminIngress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
21 ingressClassName: {{ .Values.adminIngress.ingressClassName | quote }}
22 {{- end }}
23 rules:
24 {{- if .Values.adminIngress.hostname }}
25 - host: {{ (tpl .Values.adminIngress.hostname .) | quote }}
26 http:
27 paths:
28 {{- if .Values.adminIngress.extraPaths }}
29 {{- toYaml .Values.adminIngress.extraPaths | nindent 10 }}
30 {{- end }}
31 - path: {{ include "common.tplvalues.render" ( dict "value" .Values.adminIngress.path "context" $) }}
32 {{- if eq "true" (include "common.ingress.supportsPathType" .) }}
33 pathType: {{ .Values.adminIngress.pathType }}
34 {{- end }}
35 backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" .Values.adminIngress.servicePort "context" $) | nindent 14 }}
36 {{- end }}
37 {{- range .Values.adminIngress.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.adminIngress.servicePort "context" $) | nindent 14 }}
46 {{- end }}
47 {{- if .Values.adminIngress.extraRules }}
48 {{- include "common.tplvalues.render" (dict "value" .Values.adminIngress.extraRules "context" $) | nindent 4 }}
49 {{- end }}
50 {{- if or (and .Values.adminIngress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.adminIngress.annotations )) .Values.adminIngress.selfSigned .Values.adminIngress.secrets )) .Values.adminIngress.extraTls }}
51 tls:
52 {{- if and .Values.adminIngress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.adminIngress.annotations )) .Values.adminIngress.secrets .Values.adminIngress.selfSigned) }}
53 - hosts:
54 - {{ (tpl .Values.adminIngress.hostname .) | quote }}
55 secretName: {{ printf "%s-tls" (tpl .Values.adminIngress.hostname .) }}
56 {{- end }}
57 {{- if .Values.adminIngress.extraTls }}
58 {{- include "common.tplvalues.render" (dict "value" .Values.adminIngress.extraTls "context" $) | nindent 4 }}
59 {{- end }}
60 {{- end }}
61{{- end }}