{{- if eq .Values.postgresql.mode "integrated" }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "groombook.fullname" . }}-postgresql
  labels:
    {{- include "groombook.labels" . | nindent 4 }}
    app.kubernetes.io/component: postgresql
spec:
  type: ClusterIP
  selector:
    {{- include "groombook.selectorLabels" . | nindent 4 }}
    app.kubernetes.io/component: postgresql
  ports:
    - port: 5432
      targetPort: 5432
      protocol: TCP
      name: postgresql
{{- end }}
