"Service mesh and Kubernetes networking" cheat sheet
"Check Services and endpoints, DNS, network policy, sidecars, sync and the response flags in proxy logs."
Print Save as PDF Print style Light Dark Large type
In the print dialog, choose "Save as PDF" as the destination.
Service and endpoints
Copy kubectl get svc,endpoints web -n shop
kubectl get svc web -n shop -o jsonpath='{.spec.selector}'
kubectl get pods -n shop --show-labels
kubectl get endpointslices -n shop
DNS from a pod
Copy kubectl exec -n shop deploy/web -- cat /etc/resolv.conf
kubectl exec -n shop deploy/web -- nslookup db.shop
kubectl logs -n kube-system -l k8s-app=kube-dns --tail =20
Network policy
Copy kubectl get networkpolicy -n shop
kubectl describe networkpolicy default-deny -n shop
kubectl exec -n shop deploy/web -- curl -s -m 2 http://db:5432
Mesh health
Copy istioctl version
istioctl proxy-status
istioctl analyze -n shop
kubectl get pods -n shop
kubectl label namespace shop istio-injection=enabled
kubectl rollout restart deployment -n shop
Proxy logs and flags
Copy kubectl logs web-7d -c istio-proxy --tail =20
Flag
Meaning
UF
Upstream connection failure
UH
No healthy upstream
NR
No route configured
UC
Upstream connection terminated
URX
Retry limit exceeded
Method for a failing call
Find the first failing hop.
istioctl proxy-status: is the config SYNCED?
istioctl analyze: is the config valid?
Read the response flag.
Check endpoints, then policies (PeerAuthentication, AuthorizationPolicy).
Call the pod IP directly to take the mesh out of the picture.
Quick mesh checks
Copy istioctl analyze -n shop
istioctl proxy-status
istioctl proxy-config clusters POD.shop | head
kubectl get peerauthentication,authorizationpolicy -A
Cautions
Danger
Switching a namespace to STRICT mTLS rejects every client without a sidecar. Use PERMISSIVE first and check what is still plaintext.
Warning
Retries at several layers multiply load. Keep one layer of retries and set a budget, or a slowdown becomes an outage.
Warning
Weights in a VirtualService must add up to 100, and every subset must exist in a DestinationRule, or requests fail with 503.
Official references Read the vendor and project documentation for the full, current detail.