Interview › Istio & Service Mesh
How does Istio handle headless services and StatefulSets?
Istio & Service Mesh · Intermediate level
Answer
Istio can work with headless services and StatefulSets, but I pay close attention to service discovery, DNS, stable pod identities, and protocol behavior. Headless services expose individual pod endpoints, which may interact differently with Envoy routing and load balancing than normal ClusterIP services.
Technical explanation
Stateful workloads often use long-lived connections and identity-sensitive peer addresses, so mesh behavior must be tested before production rollout.
Subsets can still use labels, but per-pod routing may require careful hostnames or service entries depending on the use case.
For databases or brokers, verify readiness, mTLS compatibility, connection draining, and client failover behavior.
Hands-on example
StatefulSet validation:
$ kubectl get svc mydb -o yaml | grep clusterIP
$ kubectl exec deploy/client -c app -- nslookup mydb-0.mydb.default.svc.cluster.local
$ istioctl proxy-config endpoints deploy/client -n app | grep mydbRun failover tests before enabling STRICT mTLS for the data path.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Istio & Service Mesh interview questions
- How do you handle non-HTTP (TCP) traffic in Istio?
- What is the difference between Istio and an API gateway?
- How do you exclude certain ports or IP ranges from sidecar interception?
- How do Istio Gateways relate to the Kubernetes Gateway API?
- Why might traffic bypass the sidecar, and how do you verify injection?
- What is the Kubernetes Gateway API, and how is Istio adopting it?
- What is a common cause of 503 errors in Istio, and how do you diagnose it?
- How do you debug mTLS handshake failures between two services?