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

别来无恙 提交于 2019-12-06 04:14:35

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/51719932/the-difference-between-istios-destinationrule-vs-kubernetes-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!