The difference between Istio's `DestinationRule` vs Kubernetes `Service`?

8/7/2018

I just read the documentation of istio 1.0.0, especially its concept. There is one thing that I am trying to understand, especially the existence of DestinationRule. So, before using Istio, the only way to expose pods is through Kubernetes's Service object. Now, using Istio, there are DestinationRule and VirtualService.

I understand that in Kubernetes's service, we can define what pod's label should the service routes the traffic. In istio, we also capable of do that by using DestionationRule's spec.subsets.label field. What happen if we have Service and DestinationRule object in the same namespace? Does it conflicted each other?

-- Agung Pratama
istio
kubernetes

1 Answer

8/7/2018

They complement each other. You still have to define a Kubernetes service, but the Istio DestinationRules will allow you to refine "subsets" in that service, via labels, and then route traffic intelligently between subsets used in a VirtualService object. You can still see the Kubernetes Service as the global entry point, but Istio will take the routing a step further by letting you declaring "versions" that may point to different deployments.

See in the istio docs ( https://istio.io/docs/reference/config/networking/virtual-service/ ) how the VirtualService definition relates to the subsets declared in DestinationRules.

The labels that you can see in subsets have to match labels set on your deployments/pods.

-- Joel
Source: StackOverflow