J release changes
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / charts / postgresql / templates / read / svc-headless.yaml
1 {{- if eq .Values.architecture "replication" }}
2 apiVersion: v1
3 kind: Service
4 metadata:
5   name: {{ include "postgresql.readReplica.svc.headless" . }}
6   namespace: {{ .Release.Namespace | quote }}
7   labels: {{- include "common.labels.standard" . | nindent 4 }}
8     {{- if .Values.commonLabels }}
9     {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
10     {{- end }}
11     app.kubernetes.io/component: read
12   {{- if .Values.commonAnnotations }}
13   annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
14   {{- end }}
15     # Use this annotation in addition to the actual publishNotReadyAddresses
16     # field below because the annotation will stop being respected soon but the
17     # field is broken in some versions of Kubernetes:
18     # https://github.com/kubernetes/kubernetes/issues/58662
19     service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
20 spec:
21   type: ClusterIP
22   clusterIP: None
23   # We want all pods in the StatefulSet to have their addresses published for
24   # the sake of the other Postgresql pods even before they're ready, since they
25   # have to be able to talk to each other in order to become ready.
26   publishNotReadyAddresses: true
27   ports:
28     - name: tcp-postgresql
29       port: {{ include "postgresql.readReplica.service.port" . }}
30       targetPort: tcp-postgresql
31   selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
32     app.kubernetes.io/component: read
33 {{- end }}