Istio的`DestinationRule`与Kubernetes`Service`之间的区别? [英] The difference between Istio's `DestinationRule` vs Kubernetes `Service`?

查看:673
本文介绍了Istio的`DestinationRule`与Kubernetes`Service`之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚阅读了istio 1.0.0的文档,尤其是它的概念.我想了解一件事,尤其是 .因此,在使用Istio之前,公开Pod的唯一方法是通过Kubernetes的Service对象.现在,使用Istio,有DestinationRuleVirtualService.

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.

我了解在Kubernetes的服务中,我们可以定义service应该路由流量的豆荚的标签.在istio中,我们还可以通过使用DestionationRulespec.subsets.label字段来做到这一点.如果在同一个命名空间中有ServiceDestinationRule对象,会发生什么情况?彼此冲突吗?

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?

推荐答案

它们相互补充.您仍然必须定义Kubernetes服务,但是Istio DestinationRules将允许您通过标签优化该服务中的子集",然后在VirtualService对象中使用的子集之间智能地路由流量.您仍然可以将Kubernetes服务视为全局入口点,但是Istio将允许您声明可能指向不同部署的版本",从而使路由更进一步.

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.

请参见istio文档( https://istio.io/docs/reference/config/networking/virtual-service/),VirtualService定义如何与DestinationRules中声明的子集相关.

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.

这篇关于Istio的`DestinationRule`与Kubernetes`Service`之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆