Istio Virtual Service Relationship to Normal Kubernetes Service
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
An Istio VirtualService does not replace a normal Kubernetes Service. The Kubernetes Service still provides the stable network identity and endpoint selection, while the Istio VirtualService adds layer-7 routing rules such as path-based routing, header-based routing, retries, and traffic splitting on top of that service identity.
What a Kubernetes Service Still Does
A normal Kubernetes Service gives you:
- a stable DNS name
- a stable virtual IP
- selection of backend pods through labels
For example:
This service is what makes reviews.default.svc.cluster.local resolve inside the cluster. Without the service, there is no stable destination identity for clients to call.
So even in Istio, the Kubernetes Service is still the foundation.
What a VirtualService Adds
A VirtualService tells Istio how to route requests addressed to a host. It can route by path, header, method, or weight.
Example:
This does not create the service itself. It changes how Istio proxies route traffic for the host reviews.
That is the key relationship:
- Kubernetes
Servicedefines reachability - Istio
VirtualServicedefines advanced routing behavior
Where DestinationRule Fits In
When a VirtualService routes to subsets such as v1 and v2, those subsets are usually defined by a DestinationRule.
Now the full picture is:
- '
Servicegives the stable destination name' - '
DestinationRuledefines subsets and traffic policies' - '
VirtualServicedecides which traffic goes to which subset'
This separation is what makes Istio routing flexible.
Why the Service Is Still Necessary
People sometimes think the VirtualService replaces the Service because both mention a host name. But the VirtualService is not a substitute service registry entry. It is a routing policy object consumed by the sidecars or gateways.
If you delete the Kubernetes Service and leave only the VirtualService, you lose the normal service identity and endpoint backing that the mesh depends on.
That is why the relationship is additive, not replacement.
Gateway Versus In-Cluster Traffic
The same pattern applies whether traffic comes from inside the mesh or through an ingress gateway. A VirtualService can attach to a gateway and still route to a Kubernetes service host.
In other words, the VirtualService can control both:
- internal mesh traffic
- external gateway traffic
But the actual backend destination usually still maps to a Kubernetes service.
A Good Mental Model
Think of the Kubernetes Service as the stable destination object and the Istio VirtualService as the policy that tells the mesh what to do with requests for that destination.
If all you need is plain service discovery, a normal Service is enough. If you need canary rollout, traffic shifting, retries, or header-based routing, add Istio routing resources on top.
Common Pitfalls
- Assuming a
VirtualServicereplaces a KubernetesServiceleads to broken mental models about how endpoint discovery actually works. - Defining subset routes in a
VirtualServicewithout a matchingDestinationRuleleaves Istio without the subset definitions you intended. - Using the wrong host value in the
VirtualServicecan make the routing rule apply to a different service name than expected. - Treating Kubernetes Service load balancing and Istio layer-7 routing as the same feature hides where traffic behavior is really being controlled.
- Debugging pod labels before confirming the base
Serviceresolves and selects endpoints can waste time when the problem is the routing policy host or subset configuration.
Summary
- A Kubernetes
Serviceand an IstioVirtualServicehave different jobs. - The
Serviceprovides stable naming and endpoint reachability. - The
VirtualServiceadds advanced layer-7 routing rules on top of that destination. - '
DestinationRuleusually defines the subsets thatVirtualServiceroutes to.' - In Istio, the
VirtualServiceextends the normal service model rather than replacing it.
Related reading
- Jenkins and Kubernetes Integration using with Helm
- Jenkins Kubernetes Plugin declarative pipeline and pod template inheritance
- Jenkins Plugin for Kubernetes Deployment EKS
- Jupyterhub helm install timed out waiting for the condition
- k3s MetalLB metallb-controller Failed to allocate IP for default/nginx no available IPs
- k8s - livenessProbe vs readinessProbe
- K8S Cronjob PVC cleanup
- K8S Error running load balancer syncing routine

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.