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