<p>I would like to view the configuration file of  CoreDNS service.</p>
<p>When i look in to the coredns deployment file it is shown as</p>
<pre><code>  spec:
  containers:
  - args:
    - -conf
    - /etc/coredns/Corefile
    image: k8s.gcr.io/coredns:1.6.7
    imagePullPolicy: IfNotPresent
</code></pre>
<ul>
<li>Is the /etc/coredns/Corefile  inside the container</li>
<li>If yes,How to view it.. i am unable to get in to the coredns container</li>
<li>If i change the coredns config map file, will the /etc/coredns/Corefile also change</li>
</ul>
<p><a href="https://i.stack.imgur.com/mY1DP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mY1DP.png" alt="Coredns pods" /></a></p>
<p><a href="https://i.stack.imgur.com/NEtd4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NEtd4.png" alt="Unable to get in to coredns pod" /></a></p>

Sivakumarj
<p>Basically Corefile is included in coredns which is a  kind of ConfigMap in Kubernetes.</p>
<ol>
<li>To view it you have to check ConfigMap resourse.</li>
</ol>
<pre><code>kubectl get ConfigMap coredns -n kube-system -o yaml

</code></pre>
<p>2.If you change coredns ConfigMap data Corefile then /etc/cordns/Corefile will be changed also.you can check this <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/" rel="nofollow noreferrer">document</a>.</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 . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }
</code></pre>
