Troubleshooting Service Discovery

Learn how to troubleshoot Service discovery.

Kubernetes DNS components

Kubernetes makes service registration and service discovery automatic. However, a lot is happening behind the scenes, and knowing how to inspect and restart things is helpful.

As mentioned, Kubernetes uses the cluster DNS as its built-in service registry. This runs as one or more managed Pods with a Service object providing a stable endpoint. The important components are:

  • Pods: Managed by the coredns Deployment

  • Service: A ClusterIP Service called kube-dns listening on port 53 TCP/UDP

  • EndpointSlice objects: Names pre-fixed with kube-dns

All of these objects are in the kube-system Namespace and tagged with the k8s-app=kube-dns label to help us find them more easily.

Playground

Use the following terminal to execute the commands for this lesson.

Get hands-on with 1400+ tech skills courses.