kubectl get svc -AKubernetes Network Debugging Cheat Sheet
Debug Services, DNS, Ingress, network policies, connectivity, endpoints, and port-forwarding issues.
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
Services and Endpoints
bashANYservicesnetworking
bash
bashANYservicesdescribe
bash
kubectl describe svc <service> -n <namespace>bashANYendpointsservices
bash
kubectl get endpoints -AbashANYendpointslicesservices
bash
kubectl get endpointslices -AbashANYendpointslicesdescribe
bash
kubectl describe endpointslice <name> -n <namespace>bashANYservicesselectors
bash
kubectl get svc <service> -n <namespace> -o jsonpath='{.spec.selector}{"
"}'DNS and Ingress
bashANYingressnetworking
bash
kubectl get ingress -AbashANYingressdescribe
bash
kubectl describe ingress <name> -n <namespace>bashANYdnsdebug-pod
bash
kubectl run dnsutils -n <namespace> --image=registry.k8s.io/e2e-test-images/agnhost:2.39 --restart=Never -it --rm -- /bin/shbashANYdnsservices
bash
kubectl exec -it <pod> -n <namespace> -- nslookup <service>.<namespace>.svc.cluster.localbashANYdnscontainers
bash
kubectl exec -it <pod> -n <namespace> -- getent hosts <service>.<namespace>.svc.cluster.localbashANYdnscoredns
bash
kubectl get pods -n kube-system -l k8s-app=kube-dnsbashANYdnslogs
bash
kubectl logs -n kube-system -l k8s-app=kube-dns --all-containers=true --prefixConnectivity Testing
bashANYport-forwardservice
bash
kubectl port-forward svc/<service> -n <namespace> 8080:80bashANYcurlservice
bash
curl -i http://127.0.0.1:8080/bashANYcurlnetworking
bash
kubectl exec -it <pod> -n <namespace> -- curl -i http://<service>.<namespace>.svc.cluster.local:<port>/bashANYwgetnetworking
bash
kubectl exec -it <pod> -n <namespace> -- wget -S -O- http://<service>:<port>/bashANYtcpnc
bash
kubectl exec -it <pod> -n <namespace> -- nc -vz <service> <port>bashANYportsnetworking
bash
kubectl exec -it <pod> -n <namespace> -- ss -lntupNetwork Policies
bashANYnetworkpolicysecurity
bash
kubectl get networkpolicies -AbashANYnetworkpolicydescribe
bash
kubectl describe networkpolicy <name> -n <namespace>bashANYlabelsnetworkpolicy
bash
kubectl get pod <pod> -n <namespace> --show-labelsbashANYegressnetworkpolicy
bash
kubectl exec -it <pod> -n <namespace> -- curl -I https://example.comService Debug Playbook
bashANYservicesselectors
bash
kubectl get pods -n <namespace> -l app=<label> -o wideCheck pod readiness gates for service endpoints
Non-ready pods usually do not appear as ready endpoints.
bashANYservicesreadiness
bash
kubectl get pod <pod> -n <namespace> -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"
"}'bashANYservicesendpoints
bash
kubectl get svc <service> -n <namespace> -o yaml && kubectl get endpoints <service> -n <namespace> -o yamlMore in Kubernetes Debugging
Kubernetes Logs and Events Cheat Sheet
Find pod logs, previous container logs, event timelines, kube-system logs, and cluster incident evidence quickly.
Kubernetes Node Debugging Cheat Sheet
Diagnose node readiness, kubelet issues, pressure conditions, cordon/drain, and node-level debugging with kubectl debug.
Kubernetes Pod Debugging Cheat Sheet
Troubleshoot Pending, CrashLoopBackOff, image pull, readiness, liveness, and init container problems.
Kubernetes Debugging Cheat Sheet
Core kubectl troubleshooting commands for pods, deployments, services, events, logs, exec sessions, and ephemeral debugging.