kind: ConfigMap
apiVersion: v1
metadata:
  name: coredns
  namespace: kube-system
  labels:
    k8s-app: coredns
data:
  Corefile: |
    .:53 {
        errors
        health
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
        }
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
        import custom/*.override
    }
    import custom/*.server
    {{- range .Values.managed_dns }}
    {{ . }}:53 {
      errors
      cache 30
      forward . {{ join " " $.Values.managed_dns_resolvers }}
    }
    {{ end }}