apiVersion: v1
kind: Service
metadata:
  name: {{ template "postgresql.fullname" . }}-headless
  labels:
  {{- include "common.labels.standard" . | nindent 4 }}
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "postgresql.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  {{- end }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - name: tcp-postgresql
      port: {{ template "postgresql.port" . }}
      targetPort: tcp-postgresql
  selector:
  {{- include "common.labels.matchLabels" . | nindent 4 }}
