blob: d8db51e7300a2c8494bc1ec7b624816acc08a9a4 [file] [log] [blame]
Oleksandr Kozachenkob0093492023-09-06 21:43:47 +02001{{- /*
2Copyright VMware, Inc.
3SPDX-License-Identifier: APACHE-2.0
4*/}}
5
6apiVersion: v1
7kind: Service
8metadata:
9 name: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
10 namespace: {{ include "common.names.namespace" . | quote }}
11 labels: {{- include "common.labels.standard" . | nindent 4 }}
12 app.kubernetes.io/component: keycloak
13 {{- if .Values.commonLabels }}
14 {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
15 {{- end }}
16 {{- if or .Values.commonAnnotations .Values.service.headless.annotations }}
17 annotations:
18 {{- if .Values.service.headless.annotations }}
19 {{- include "common.tplvalues.render" ( dict "value" .Values.service.headless.annotations "context" $ ) | nindent 4 }}
20 {{- end }}
21 {{- if .Values.commonAnnotations }}
22 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
23 {{- end }}
24 {{- end }}
25spec:
26 type: ClusterIP
27 clusterIP: None
28 ports:
29 - name: http
30 port: {{ coalesce .Values.service.ports.http .Values.service.port }}
31 protocol: TCP
32 targetPort: http
33 {{- if .Values.tls.enabled }}
34 - name: https
35 port: {{ coalesce .Values.service.ports.https .Values.service.httpsPort }}
36 protocol: TCP
37 targetPort: https
38 {{- end }}
39 {{- if .Values.service.extraHeadlessPorts }}
40 {{- include "common.tplvalues.render" (dict "value" .Values.service.extraHeadlessPorts "context" $) | nindent 4 }}
41 {{- end }}
42 {{- if .Values.service.headless.extraPorts }}
43 {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.extraPorts "context" $) | nindent 4 }}
44 {{- end }}
45 publishNotReadyAddresses: true
46 selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
47 app.kubernetes.io/component: keycloak