Interview Prep/Networking/Containers, Kubernetes, IPv6 and packet captures

After enabling Istio sidecar injection, a service returns `upstream connect error or disconnect/reset before headers. reset reason: connection failure`.

AdvancedTroubleshootingContainers, Kubernetes, IPv6 and packet captures
Answer

Likely causes → Envoy can't connect to the destination: mTLS mode mismatch (STRICT on the server, client without a sidecar), a DestinationRule with the wrong TLS mode, the app listening on 127.0.0.1 only (sidecar forwards to the pod IP), a port named with the wrong protocol prefix, or the app starting before the sidecar is ready.

Diagnose →

istioctl analyze -n myns
istioctl proxy-config endpoints deploy/client -n myns | grep myservice
kubectl logs deploy/myservice -c istio-proxy -n myns | tail
kubectl get peerauthentication,destinationrule -A

Fix → Align PeerAuthentication and DestinationRule TLS settings (ISTIO_MUTUAL), make the app listen on 0.0.0.0, name ports correctly (http-, grpc-) or set appProtocol, and enable holdApplicationUntilProxyStarts: true.

Prevent → Roll out mTLS with PERMISSIVE first, then STRICT per namespace after checking traffic, and run istioctl analyze in CI.

All Networking questions Roadmap: Networking for DevOps

More on Containers, Kubernetes, IPv6 and packet captures