Troubleshooting networking
In Chapter 7, Demystifying Kubernetes Networking, we learned that the Kubernetes DNS server creates DNS records (A/AAAA, SRV, and PTR records) for services and pods in Kubernetes. Those efforts allow you to contact Services with consistent DNS names in place of the IP addresses. The Kubernetes DNS server does this by scheduling a few copies of DNS pods and services on the Kubernetes cluster.
In the following section, let’s talk about how to troubleshoot the Kubernetes DNS service.
Troubleshooting a Kubernetes DNS server
To troubleshoot the networking of Kubernetes, we start by checking the status of the DNS server. Using minikube
as a local cluster this time, we use the following command to check whether the DNS server is up and running on your cluster:
kubectl get pods -n kube-system | grep dns
The output should be similar to the following:
coredns-64897985d-brqfl 1/1 Running 1 (2d ago) 2d
From the preceding output, we can...