How would you debug a Service that returns "connection refused" or times out?
IntermediateProductionObservability & Day-2 Operations
Answer
Walk the path: Pod Ready? kubectl get endpointslices populated? Selector matches labels? targetPort equals the container port? App binds to 0.0.0.0 and not localhost? NetworkPolicy blocking? kube-proxy/CNI healthy on the node? Test from a debug Pod to the Pod IP, then to the ClusterIP, then DNS.
kubectl get endpointslices -l kubernetes.io/service-name=web
kubectl run t --rm -it --image=nicolaka/netshoot -- curl -sv web.shop.svc:80
More on Observability & Day-2 Operations
What are the three pillars of observability and the standard tools on Kubernetes?BeginnerWhat is kube-state-metrics and how does it differ from metrics-server?BeginnerWhich alerts do you set up first on a cluster?BeginnerWhere do container logs live and how do you ship them?BeginnerWhat is the difference between `kubectl logs --previous` and `kubectl logs -f`?BeginnerWhat does a good runbook for a Kubernetes alert include?Beginner