{{- if .Values.postgresql.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "openstack-api-simulator.postgresqlHost" . }}
  labels:
    {{- include "openstack-api-simulator.labels" . | nindent 4 }}
    app.kubernetes.io/component: postgresql
spec:
  type: ClusterIP
  ports:
    - port: 5432
      targetPort: postgresql
      protocol: TCP
      name: postgresql
  selector:
    app.kubernetes.io/name: {{ include "openstack-api-simulator.name" . }}-postgresql
    app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
