This article walks through several common Istio troubleshooting scenarios you may encounter in practice or on exams. Each example presents a realistic failure, the diagnostic commands to run, the root cause, and the minimal fix to restore traffic. ContentsDocumentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- Cross-namespace mTLS / sidecar injection mismatch (alpha ← charlie)
- Deployment annotation preventing sidecar injection (beta)
- VirtualService destination/port mismatch (delta → httpbin)
- Gateway / VirtualService misconfiguration for external access (alpha → helloworld)
1) Cross-namespace call failing: “connection reset by peer”
Problem summary- From a pod in namespace
charlie, a curl tohelloworld.alpha.svc.cluster.local:5000/hellofails with “connection reset by peer”. - Typical root cause: a global mTLS policy (PeerAuthentication) in STRICT mode while the source pod does not have an Istio sidecar injected.
- Verify namespace labels (to confirm injection is enabled):
- Inspect cluster PeerAuthentication policies (global policy is commonly in
istio-system):
- A PeerAuthentication in STRICT mode enforces mTLS for traffic between sidecars. If the client or server pod has no sidecar, Envoy mTLS handshakes fail and you may see “connection reset by peer”.
istioctl analyze to discover injection-related problems:
- Label the namespace if it is not labeled:
- Recreate the source pod so it gets the sidecar. For example:
- Confirm the pod becomes 2/2 (application + istio-proxy):
- Retry the request from the
charliepod (here the pod name iscurl):
- When you discover PeerAuthentication set to STRICT, ensure both client and server pods have sidecars injected. Use
istioctl analyzeandkubectl get ns --show-labelsearly in the troubleshooting flow.
If PeerAuthentication is set to
STRICT, missing sidecars (or non-Istio traffic) will be rejected. Run istioctl analyze and check namespace labels (kubectl get ns --show-labels) at the start of troubleshooting.2) Deployment has an annotation disabling sidecar injection (beta)
Problem summary- Pods in namespace
betafrom thecurlDeployment show1/1READY, meaning the Istio sidecar was not injected even though the namespace may be labeled.
describe output you may see:
- The pod template annotation
sidecar.istio.io/inject: "false"prevents automatic sidecar injection for pods created by that Deployment, even if the namespace is labeled for injection.
- Edit the Deployment to remove or set the annotation to
"true":
- After editing, a rolling update will create new pods with the sidecar. Verify the new pods are
2/2:
istio-proxy container is present and Ready: True for both containers.
On exams and in production, watch for
sidecar.istio.io/inject: "false" in resource templates. Removing that annotation or setting it to "true" will re-enable injection when the namespace is labeled.3) 503 Service Unavailable due to VirtualService destination/port mismatch (delta → httpbin)
Problem summary- From
charlie,curl httpbin.delta.svc.cluster.local:8000/getreturns HTTP/1.1 503 Service Unavailable. This usually means Envoy cannot find an upstream endpoint matching the VirtualService destination.
- The VirtualService routes traffic to
httpbin.charlie.svc.cluster.local:5000, while the actual Kubernetes Service ishttpbin.delta.svc.cluster.locallistening on port8000. Envoy cannot resolve an upstream (host/port mismatch), so it replies 503.
- Edit the VirtualService to point to the correct service and port:
- Always confirm the Kubernetes Service name and port that the VirtualService destination expects. Mismatches between VirtualService destinations and Services are a frequent source of 503s.
4) External access via Gateway / VirtualService — selector & routing issues (alpha → helloworld)
Problem summary- Exposing
helloworldin namespacealphavia an Istio Gateway and VirtualService. External curl to the ingress IP with Host headerhello.kodekloud.cominitially fails (connection refused or 404).
- Find the external ingress IP (istio-ingressgateway):
- Inspect the Gateway resource:
- The Gateway’s
selectormust match the labels on the ingress gateway Pod/Service (commonlyistio: ingressgateway). If the selector is wrong, Envoy in the ingress pods will not load or bind the Gateway config and external connections will fail.
- Inspect the VirtualService:
- If a VirtualService does not include the external
hosts(e.g.hello.kodekloud.com) and is not associated with the Gateway via thegateways:field, the ingress Gateway will not route external requests to the service. That results in 404 responses.
<INGRESS_IP>):
| Issue | What to check | Fix |
|---|---|---|
| Gateway selector mismatch | Does spec.selector match labels on istio-ingressgateway service/pods? | Update selector to match istio: ingressgateway (or your installation’s label). |
VirtualService missing gateways or external hosts | Does the VirtualService include gateways: and the external host (e.g. hello.kodekloud.com)? | Add gateways: with the Gateway name and include external hosts. |
| Service/port mismatch | Does the VirtualService’s destination port match the Kubernetes Service port? | Ensure VirtualService destination host and port match the Service. |
Final tips & troubleshooting checklist
- Always confirm Kubernetes Service names and ports before editing VirtualServices.
- Use
istioctl analyzeto surface common configuration and injection issues. - When PeerAuthentication is STRICT, both client and server must have Istio sidecars injected.
- Check for pod-template annotations or Deployment-level annotations that disable injection:
sidecar.istio.io/inject. - For Gateways:
- Ensure Gateway
spec.selectormatches the ingress gateway labels (commonlyistio: ingressgateway). - Ensure the VirtualService lists the Gateway name under
gateways:and includes the externalhostsentry.
- Ensure Gateway
- During exams: label namespaces, edit/patch resources, and recreate pods when necessary. Partial credit may be awarded for correct troubleshooting steps even if a full fix is not completed.