How to enable coreDNS debug logging for TKGi clusters.
search cancel

How to enable coreDNS debug logging for TKGi clusters.

book

Article ID: 414623

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

In some instances of troubleshooting, it is useful to see pod DNS requests that are being made through the coreDNS in a cluster. This article will show how to enable debug logging for TKGi Clusters.

Environment

TKGI

Resolution

coreDNS debug logging can be enabled with the command:

kubectl -n kube-system edit configmap coredns


 Then add the lines log and debug in the Corefile section, like so

apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health
        log
        debug
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
          ttl 30
        }
        prometheus :9153
        forward . /etc/resolv.conf {
          policy sequential # needed for workloads to be able to use BOSH-DNS
        }
        cache 30
        loop
        reload
        loadbalance
    }

...

Once applied, you should see the DNS requests being logged when you run kubectl logs coredns-<id> -n kube-system