/kubernetes-platform-skills:kubernetes-service-connectivity-troubleshootingfrom kubernetes-platform-skills
Diagnoses Kubernetes Service connectivity issues: empty endpoints, traffic not reaching pods, selector mismatches, probe failures, and DNS resolution problems with CoreDNS or NetworkPolicy.
Ships in kubernetes-platform-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A Kubernetes Service is just a stable virtual IP and DNS name backed
by a continuously reconciled list of pod IPs — its Endpoints/
EndpointSlice — populated automatically from pods matching its
spec.selector and currently passing readiness. When traffic doesn't
reach a workload, the fault almost always lives in one of three narrow
places: the selector doesn't actually match the pods it's meant to (a
label typo or case mismatch), the pods match but aren't currently
Ready (excluding them from Endpoints correctly, not as a bug), or DNS
resolution for the Service name itself is failing for an unrelated
reason (CoreDNS health, or a NetworkPolicy blocking DNS traffic). Each
produces a similar-looking "can't connect" symptom but needs a different
fix, and jumping straight to loosening a selector or disabling a
NetworkPolicy tends to create a new, worse problem instead of finding
the real one. This skill covers the diagnostic sequence for all three.
kubectl get endpoints/endpointslices for a Service returns empty
despite pods that appear to be running.ClusterIP or DNS name.nslookup/DNS resolution for a Service name fails or times out from
inside a pod.kubectl access to inspect Service, Endpoints/EndpointSlice,
and Pod objects in the relevant namespace(s).kube-system (the standard in-cluster DNS
provider) — confirm it's healthy before assuming a DNS-specific
problem is application- or Service-specific.spec.selector maps to pod
metadata.labels — matching is an exact key/value match (case- and
whitespace-sensitive), not a fuzzy or partial match.Check the Service's selector and its Endpoints together, side by side — don't eyeball the YAML from memory:
kubectl get svc <name> -n <namespace> -o jsonpath='{.spec.selector}{"\n"}'
kubectl get endpoints <name> -n <namespace>
kubectl get endpointslice -n <namespace> -l kubernetes.io/service-name=<name>
Empty Endpoints/no EndpointSlice addresses is the first branch
point: either no pod matches the selector at all, or pods match but
none are currently Ready (Kubernetes only populates Endpoints with
ready pod IPs).
Compare the selector against actual pod labels exactly:
kubectl get pods -n <namespace> --show-labels
Check every key in the Service's selector is present on the pods
with an exactly matching value — a Service selector with an extra
key the pods don't have at all, a typo'd label key/value, or a case
mismatch (App: payments vs. app: payments) all produce a silent
zero-match with no error from the API server on either side.
If labels match but Endpoints are still empty, check pod
readiness — a Running pod that hasn't passed its readiness probe
is deliberately excluded:
kubectl get pods -n <namespace> -o wide
kubectl describe pod <pod> -n <namespace>
Look for Readiness probe failed in the pod's events, and check the
probe's configured port/path against what the container actually
serves.
Test the readiness probe's target manually from inside the container to confirm whether it's a probe-configuration problem or a real application issue:
kubectl exec <pod> -n <namespace> -- curl -sf localhost:<port><path>
A probe pointed at the wrong port/path, or one with too short a
failureThreshold/periodSeconds for the app's real response time,
produces the same "no endpoints" symptom as an actually-unhealthy
app — this step distinguishes them. See
pod-crashloop-and-oom-troubleshooting
for the closely related liveness-probe failure mode, which restarts
the container instead of just excluding it from Endpoints.
Once Endpoints are populated, test the pod IP directly, bypassing the Service layer, before assuming the Service itself works:
kubectl run net-test -n <namespace> --image=busybox:1.36 --rm -it --restart=Never -- \
wget -qO- --timeout=2 <pod-ip>:<port>
If this fails too, the problem is at the pod/network level (the
application isn't actually listening, a NetworkPolicy is blocking
the specific port, or a cross-node CNI issue), not the Service
abstraction.
If the pod IP works but the Service ClusterIP/DNS name doesn't,
check kube-proxy (or your CNI's Service-implementing component,
for CNIs with an alternative Service data path):
kubectl get pods -n kube-system -l k8s-app=kube-proxy
kubectl logs -n kube-system <kube-proxy-pod>
A missing or crash-looping kube-proxy on the client's node means
that node has no iptables/IPVS rules programmed for any
ClusterIP, which looks like every Service is broken from that
node specifically.
For DNS-specific failures, test resolution directly and check CoreDNS itself:
kubectl exec <pod> -n <namespace> -- nslookup <service>.<namespace>.svc.cluster.local
kubectl get pods -n kube-system -l k8s-app=kube-dns
kubectl logs -n kube-system -l k8s-app=kube-dns
If CoreDNS pods are healthy but resolution still fails from a
specific namespace/pod, check for a default-deny NetworkPolicy
without an explicit egress allow rule for DNS (UDP/TCP port 53 to
kube-system) — see
cni-networking-calico-flannel
for NetworkPolicy enforcement details; a policy-enforcing CNI
applies a DNS-blocking default-deny exactly as configured, silently,
with no distinct error visible from the client side.
For a headless Service (clusterIP: None) or StatefulSet DNS
returning no records, check the specific fields that govern
per-pod DNS rather than the usual Service selector path:
kubectl get svc <name> -n <namespace> -o yaml | grep clusterIP
kubectl get statefulset <name> -n <namespace> -o jsonpath='{.spec.serviceName}'
The StatefulSet's spec.serviceName must reference the exact
headless Service backing it for per-pod DNS records
(<pod>.<service>.<namespace>.svc.cluster.local) to be created.
For an Ingress that routes but times out reaching the backend, confirm the failure is at the Service layer and not the Ingress controller itself by testing the Service directly (steps 1–6) before assuming an Ingress-specific misconfiguration — see ingress-nginx-configuration for Ingress-specific 502/504 diagnosis once the backing Service is confirmed healthy on its own.
Fix the actual root cause — correct the mismatched label
(on the Deployment/pod template, not by loosening the Service
selector), fix the probe's port/path/timing (or the health endpoint
it checks), add the missing NetworkPolicy egress-allow rule for
DNS, or fix the headless Service/serviceName reference — then
re-run steps 1 and 5 to confirm Endpoints populate and traffic
actually reaches the pod, not just that the symptom superficially
disappeared.
kubectl
output compared side by side, not by reading YAML from memory — label
mismatches are frequently a single case or whitespace difference that
is easy to miss visually.resolv.conf
is wrong" — these three have different fixes and are easy to conflate
under a single "DNS is broken" label.Symptom: A Service has zero Endpoints despite pods that are
clearly Running and appear to be the intended backend.
Fix: Compare kubectl get svc -o jsonpath='{.spec.selector}'
against kubectl get pods --show-labels directly — a label typo,
case mismatch, or an extra selector key not present on the pods at
all is the most common cause, and neither side surfaces an error for
it since selector matching is silent by design.
Symptom: A pod intermittently appears and disappears from a
Service's Endpoints even though it looks healthy and its logs show no
errors.
Fix: Its readiness probe is intermittently failing — check the
probe's configured port/path and failureThreshold/periodSeconds
against the app's actual response behavior. A pod excluded from
Endpoints purely due to failing readiness is Kubernetes working
correctly, not a bug; fix the probe or the underlying slow-response
cause, don't treat the exclusion itself as the problem.
Symptom: DNS resolution for <service>.<namespace>.svc.cluster.local
times out or fails from within specific pods, while CoreDNS pods
themselves show Running and healthy.
Fix: Check for a default-deny NetworkPolicy in that namespace
with no explicit egress-allow for DNS (UDP/TCP port 53 to
kube-system) — a policy-enforcing CNI blocks DNS exactly as silently
as any other denied traffic, and "CoreDNS is up" does not rule this
out. Add an explicit DNS egress-allow rule alongside the intended
application-traffic rules.
Symptom: An empty-Endpoints Service is "fixed" by progressively removing keys from its selector until it starts matching something. Fix: This routes traffic to whatever pods happen to match the now-overbroad selector, which is very likely the wrong backend rather than the intended one — find and correct the actual label mismatch on the target Deployment/pods instead of loosening the Service's matching criteria to paper over it.
Symptom: A headless Service backing a StatefulSet returns no DNS
records for individual pods (<pod-name>.<service>.<namespace>.svc .cluster.local).
Fix: Confirm the Service has clusterIP: None and that the
StatefulSet's spec.serviceName field references that exact Service
by name — per-pod DNS records are only created when this link is
correct, and a StatefulSet pointed at the wrong (or a non-headless)
Service name produces no per-pod records with no explicit error.
Symptom: Traffic reaches a pod's IP directly but not through the
Service's ClusterIP, and this is isolated to client pods on one
specific node.
Fix: Check kube-proxy (or the CNI's Service-dataplane
equivalent) on that specific node — a crashed or misconfigured
kube-proxy there means no iptables/IPVS rules exist for any
ClusterIP from that node's perspective, which looks like a
single-Service failure but is actually node-wide.
Scenario: payments-api clients get connection refused hitting the
Service; separately, a different pod fails to resolve
billing.finance.svc.cluster.local.
kubectl get svc payments-api -n payments -o jsonpath='{.spec.selector}{"\n"}'
# {"app":"payments"}
kubectl get endpoints payments-api -n payments
# NAME ENDPOINTS AGE
# payments-api <none> 3h
kubectl get pods -n payments --show-labels
# NAME READY STATUS LABELS
# payments-api-7d9f6-abc12 1/1 Running app=payments-api
The Service selector (app: payments) doesn't match the pod's actual
label (app: payments-api) — a naming-convention drift, not a probe or
network issue.
kubectl patch deployment payments-api -n payments --type merge \
-p '{"spec":{"template":{"metadata":{"labels":{"app":"payments"}}}}}'
kubectl get endpoints payments-api -n payments
# NAME ENDPOINTS
# payments-api 10.244.2.14:8080,10.244.3.9:8080
Endpoints populate immediately once the label matches, confirming the fix.
Second issue, in a different namespace:
kubectl exec -n reporting deploy/reporting-job -- \
nslookup billing.finance.svc.cluster.local
# ;; connection timed out; no servers could be reached
kubectl get pods -n kube-system -l k8s-app=kube-dns
# coredns-... 1/1 Running (both replicas healthy)
kubectl get networkpolicy -n reporting -o yaml
# a default-deny-all-egress policy with no DNS (port 53) exception
CoreDNS itself is healthy — the reporting namespace's default-deny
egress NetworkPolicy has no explicit allow rule for DNS traffic to
kube-system. Adding one resolves it:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: { name: allow-dns-egress, namespace: reporting }
spec:
podSelector: {}
policyTypes: ["Egress"]
egress:
- to: [{ namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: kube-system } } }]
ports:
- { protocol: UDP, port: 53 }
- { protocol: TCP, port: 53 }
kubectl apply -f allow-dns-egress.yaml
kubectl exec -n reporting deploy/reporting-job -- \
nslookup billing.finance.svc.cluster.local
# Address: 10.96.44.201
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
35 skills in this plugin
/cert-manager-tls-automationGuides installing and configuring cert-manager for automated TLS certificate issuance and renewal — Issuers vs. ClusterIssuers, ACME/ Let's Encrypt HTTP-01 and DNS-01 challenges, private-CA issuance, and integration with Ingress-nginx and Istio gateways. Use when a user asks to "automate TLS certificates on Kubernetes," "set up cert-manager with Let's Encrypt," "fix a stuck Certificate that won't become Ready," "use DNS-01 for a wildcard cert," "rotate mTLS certs automatically," or "issue certs from an internal CA."
/cni-networking-calico-flannelGuides choosing and installing a Kubernetes CNI plugin — Calico vs. Flannel — including NetworkPolicy enforcement capability differences, BGP vs. VXLAN/overlay data paths, and IP address management (IPAM) tradeoffs. Use when a user asks to "choose a CNI plugin for Kubernetes," "enable NetworkPolicy enforcement," "set up Calico with BGP peering," "install Flannel," "debug pod-to-pod connectivity across nodes," or "migrate from Flannel to Calico."
/complete-kubernetes-deployment-on-aks-from-scratchSequences a complete, end-to-end AKS deployment from a bare Azure subscription to a production-ready cluster serving a first workload — Azure landing zone prerequisites, AKS cluster and node pool provisioning, Azure CNI (with the Calico/Cilium alternative noted), ingress (Application Gateway Ingress Controller vs. ingress-nginx), cert-manager with Azure DNS, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on AKS from scratch," "set up a new AKS environment end to end," "build a production AKS cluster from a fresh Azure subscription," or "give me the full sequence to go from nothing to a working AKS cluster."
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin kubernetes-platform-skillsOther plugins' skills for the same job