如果应用Istio上的'Destination Rule',k8s Service的负载均衡是不是就不行了?

If 'Destination Rule' on Istio is applied, does load balancing of k8s Service not work?

我了解到 k8s 服务基本上在 Pods 上执行 Round Robin。

如果我使用 Istio 的 'Destination Rule' 设置 pods 的权重,现有 k8s 服务的 RR 会发生什么? k8s服务中的负载均衡规则是否被忽略?

I understand that the k8s Service basically performs ROUND ROBIN on Pods.`

没错。它在 kubernetes 文档 here.

中有解释

If I set the weight of the pods using the 'Destination Rule' of the Istio, what happens to RR of the existing k8s Service? Are load balancing rules in k8s Service ignored?

我找不到具体的工作原理,所以我将解释我的理解。

由于 kubernetes 服务使用 kube-proxy 的 iptables 规则分发请求,我假设 istio destination rule 可以用他自己的规则覆盖它,并通过 envoy sidecar 应用它们。由于您的网格服务发送和接收的所有流量(数据平面流量)都通过 Envoy 代理,因此无需对您的服务进行任何更改即可轻松引导和控制网格周围的流量。

因此,如果您想将默认的 ROUND ROBIN 更改为其他算法(例如 LEAST_CONN、RANDOM),您只需在目标规则 LoadBalancerSettings.SimpleLB 中进行配置即可。请注意,默认情况下算法也是 ROUND ROBIN,与 kubernetes 服务相同。

更多信息here


其他资源: