Bitzu

KCNA ยท Application delivery and debugging

Debugging connectivity and configuration

Service selectors and endpoints, DNS checks, wrong config or env, network policy blocks.

Key points

  • A Service sends traffic only to Ready Pods whose labels match its selector; those are its endpoints.
  • Empty endpoints: check selector against Pod labels, and Pod readiness.
  • Endpoints exist but requests fail: check targetPort matches the app's port, then NetworkPolicies.
  • DNS: nslookup from a Pod (name, name.namespace or full svc.cluster.local form).
  • Also inspect env vars and mounted config for typos.

Source: https://kubernetes.io/docs/tasks/debug/debug-application/debug-service/

Practice questions

Single choice

A Service shows no endpoints. What is the most likely cause?

  1. Its selector matches no Ready Pods
  2. The cluster has too many nodes
  3. The Service name is too long
  4. kubectl is out of date
Show answer

Answer: A. Its selector matches no Ready Pods

Endpoints are built from Pods that match the selector and are Ready, so no match or no ready Pods means an empty list.

Select all that apply

Which statements about checking Service DNS from a Pod are correct?

  1. nslookup <service> can be run from a debug Pod
  2. From another namespace, <service>.<namespace> can be used
  3. The full form is <service>.<namespace>.svc.cluster.local
  4. A Service name resolves to the IP of one specific Pod
  5. DNS names are case-sensitive Pod labels
Show answer

Answer: A. nslookup <service> can be run from a debug Pod, B. From another namespace, <service>.<namespace> can be used, C. The full form is <service>.<namespace>.svc.cluster.local

The page's checks use short, namespaced and fully qualified names. A Service name resolves to its ClusterIP, not one Pod.

True or false

True or false: if a Service has endpoints, requests through it cannot fail.

Show answer

Answer: False

Endpoints exist but may point to a port nothing listens on (targetPort mismatch), or a NetworkPolicy may block the traffic.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More KCNA topics in this module