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