dot_config/opencode/skills/debugging-k8s-networking/SKILL.md
Debugs Kubernetes networking issues including Service connectivity, DNS resolution, Ingress routing, Endpoints, and NetworkPolicy. Use when services are unreachable, DNS fails, ingress not routing, or network connectivity problems.
npx skillsauth add rio/dotfiles debugging-k8s-networkingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Investigates Service, DNS, Ingress, and connectivity issues.
| Symptom | Likely Cause | First Check | |---------|-------------|-------------| | Service unreachable | No endpoints, selector mismatch | Endpoints exist | | DNS not resolving | CoreDNS issue, wrong service name | DNS from inside pod | | Ingress not routing | Missing backend, TLS issue | Ingress + Service config | | Connection refused | Pod not listening, wrong port | Target port matches | | Connection timeout | NetworkPolicy blocking | NetworkPolicy rules |
# Check service exists
kubectl get svc <service> -n <ns>
# Check endpoints (should list pod IPs)
kubectl get endpoints <service> -n <ns>
# Detailed service info
kubectl describe svc <service> -n <ns>
No endpoints? Check:
# Compare service selector with pod labels
kubectl get svc <service> -n <ns> -o jsonpath='{.spec.selector}'
kubectl get pods -n <ns> --show-labels
# From inside a pod (use any running pod)
kubectl exec -it <pod> -n <ns> -- nslookup <service>
kubectl exec -it <pod> -n <ns> -- nslookup <service>.<namespace>.svc.cluster.local
# Check CoreDNS is running
kubectl get pods -n kube-system -l k8s-app=kube-dns
DNS format: <service>.<namespace>.svc.cluster.local
# From inside a pod, test connection
kubectl exec -it <pod> -n <ns> -- wget -qO- --timeout=5 http://<service>:<port>/
kubectl exec -it <pod> -n <ns> -- nc -zv <service> <port>
# Or using curl if available
kubectl exec -it <pod> -n <ns> -- curl -s --max-time 5 http://<service>:<port>/
# List NetworkPolicies
kubectl get networkpolicy -n <ns>
# Check policy details
kubectl describe networkpolicy <policy> -n <ns>
NetworkPolicy can block:
# Check if pods match selector
kubectl get svc <service> -n <ns> -o jsonpath='{.spec.selector}'
# Find pods with those labels
kubectl get pods -n <ns> -l <key>=<value>
# Check if pods are Ready
kubectl get pods -n <ns> -o wide
# Check ingress config
kubectl get ingress -n <ns>
kubectl describe ingress <ingress> -n <ns>
# Check ingress controller logs
kubectl logs -n <ingress-ns> -l app.kubernetes.io/name=ingress-nginx --tail=50
Common ingress issues:
# Check ingress class
kubectl get ingressclass
# Service targetPort must match container port
kubectl get svc <service> -n <ns> -o jsonpath='{.spec.ports[*].targetPort}'
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.containers[*].ports[*].containerPort}'
# Check what ports the container exposes
kubectl get pod <pod> -n <ns> -o jsonpath='{.spec.containers[*].ports}'
# Check if process is listening inside pod
kubectl exec -it <pod> -n <ns> -- netstat -tlnp 2>/dev/null || kubectl exec -it <pod> -n <ns> -- ss -tlnp
# Full service + endpoints overview
kubectl get svc,ep -n <ns>
# Check all ingresses
kubectl get ingress -A
# DNS debugging pod (if needed)
kubectl run -it --rm debug --image=busybox --restart=Never -- nslookup <service>.<ns>.svc.cluster.local
analyzing-k8s-events to check for network-related eventsdebugging-k8s-pods if the target pods are not healthydocumentation
Compact the current conversation into a handoff document for another agent to pick up.
development
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
testing
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
development
Retrieves Kubernetes container logs with various patterns including multi-container pods, previous container logs, init containers, and label-based aggregation. Use when checking application logs, debugging crashes, or analyzing container output.