<p>I'm very new to kubernetes, and I'm tasked to continue project which was started by someone else. I just want to understand the what the following code does to the kubernetes, especially corefile part. thank you.</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns
  namespace: kube-system
data:
  Corefile: |
    .:53 {
        errors
        health {
            lameduck 5s
        }
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
            pods insecure
            fallthrough in-addr.arpa ip6.arpa
            ttl 30
        }
        prometheus :9153
        forward . 8.8.8.8
        cache 30
        loop
        reload
        loadbalance
    }
</code></pre>

sekicdx
<p>The Corefile part is the configuration for your cluster's CoreDNS deployment. It's wrapped in a <code>ConfigMap</code> so that you can manage it like any other Kubernetes resource.</p>
<p>CoreDNS is a DNS server. Your Kubernetes cluster needs a local DNS server so that your pods, services, etc. can discover each other by name.</p>
<p>Most important:
any DNS request that can't be resolved in the local environment will be forwarded to the IP you specify at &quot;forward . [remote DNS]&quot;</p>
<p>See <a href="https://coredns.io/manual/configuration/" rel="nofollow noreferrer">https://coredns.io/manual/configuration/</a></p>
