1 {{- if eq .Values.architecture "replication" }}
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 }}
11 app.kubernetes.io/component: read
12 {{- if .Values.commonAnnotations }}
13 annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
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"
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
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