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