{{- if eq .Values.global.deploymentMode "development" }}
apiVersion: v1
kind: Service
metadata:
  name: redash-admin-postgresql-headless
  labels:
    app: {{ template "postgresql.name" . }}
    chart: {{ template "postgresql.chart" . }}
    release: {{ .Release.Name | quote }}
    heritage: {{ .Release.Service | quote }}
  {{- 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:
    app: postgresql-admin
    release: redash-admin
{{- end }}
