mirror of
https://github.com/bitnami/charts.git
synced 2026-03-07 08:07:55 +08:00
To allow multiple versions of this chart to coexist as subcharts we shouldn't only separate the helper functions by prefixing the chart name but also by suffixing incrementing function versions. This is officially recommended by Helm in https://helm.sh/docs/chart_template_guide/named_templates/. Signed-off-by: Yarden Shoham <git@yardenshoham.com> Signed-off-by: Alberto Otero <lorenzoa@vmware.com> Co-authored-by: Alberto Otero <lorenzoa@vmware.com>
39 lines
1.9 KiB
YAML
39 lines
1.9 KiB
YAML
{{- /*
|
|
Copyright VMware, Inc.
|
|
SPDX-License-Identifier: APACHE-2.0
|
|
*/}}
|
|
|
|
{{- if eq .Values.architecture "replication" }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "postgresql.v1.readReplica.svc.headless" . }}
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
app.kubernetes.io/component: read
|
|
annotations:
|
|
{{- if or .Values.readReplicas.service.headless.annotations .Values.commonAnnotations }}
|
|
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.service.headless.annotations .Values.commonAnnotations ) "context" . ) }}
|
|
{{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
# Use this annotation in addition to the actual publishNotReadyAddresses
|
|
# field below because the annotation will stop being respected soon but the
|
|
# field is broken in some versions of Kubernetes:
|
|
# https://github.com/kubernetes/kubernetes/issues/58662
|
|
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
|
|
spec:
|
|
type: ClusterIP
|
|
clusterIP: None
|
|
# We want all pods in the StatefulSet to have their addresses published for
|
|
# the sake of the other Postgresql pods even before they're ready, since they
|
|
# have to be able to talk to each other in order to become ready.
|
|
publishNotReadyAddresses: true
|
|
ports:
|
|
- name: tcp-postgresql
|
|
port: {{ include "postgresql.v1.readReplica.service.port" . }}
|
|
targetPort: tcp-postgresql
|
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.readReplicas.podLabels .Values.commonLabels ) "context" . ) }}
|
|
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
|
|
app.kubernetes.io/component: read
|
|
{{- end }}
|