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.
More on Containers, Kubernetes, IPv6 and packet captures
After someone ran `iptables -F` (or restarted firewalld), all Docker containers lost outbound connectivity.Intermediate`docker run -p 8080:80 myapp` starts fine, but `curl localhost:8080` returns `Connection reset by peer`.BeginnerTwo containers on the default bridge network can't reach each other by container name.Beginner`docker run -p 80:80 nginx` fails with `Bind for 0.0.0.0:80 failed: port is already allocated`.BeginnerA new Kubernetes node stays `NotReady` with `container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized`.IntermediateA Service returns `Connection refused` / nothing, and `kubectl get endpoints myapp` shows `<none>`.Beginner