{{- if .Values.mariadb.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "powerdns.fullname" . }}-service-db
  labels:
{{ include "powerdns.labels" . | indent 4 }}
spec:
  type: ClusterIP
  ports:
    - port: 3306
      name: db
      protocol: TCP
      targetPort: 3306
  selector:
    app.kubernetes.io/name: {{ include "powerdns.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    powerdns.com/role: db
{{ end -}}
