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