我被问到这个问题,而且我无法在网上找到有关它的信息 - Kubernetes使用哪种算法来控制pods的复制或部署中的流量(我猜它们是相同的)?
可以说,我在我的Kubernetes集群中有5个pod的副本,在replicaset中定义。群集如何在新请求中选择要转到哪个pod?它是否使用循环法?我找不到有关它的信息。
应用于确定哪个pod将处理请求的算法取决于正在运行的kube-proxy模式。
参考文献:
https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies https://sookocheff.com/post/kubernetes/understanding-kubernetes-networking-model/