apiVersion: v1
kind: Service
metadata:
  name: {{ include "node-local-dns.fullname" . }}
  namespace: kube-system
  labels:
    {{- include "node-local-dns.labels" . | nindent 4 }}

  {{- if and (not .Values.serviceMonitor.enabled) .Values.prometheusScraping.enabled }}
  annotations:
    prometheus.io/port: "9253"
    prometheus.io/scrape: "true"
  {{- end }}
spec:
  clusterIP: None
  ports:
    - name: metrics
      port: 9253
      targetPort: 9253
  selector:
    k8s-app: {{ include "node-local-dns.fullname" . }}
