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 | apiVersion: v1 |
| 7 | kind: Service |
| 8 | metadata: |
| 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 }} |
| 25 | spec: |
| 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 |