在资源可用的地方进行负载均衡

Load balancing where ressources are available

我想知道如何在 kubernetes 级别设置负载均衡器,以便我的服务指向 pods,它有更多 ram/cpu 资源可用,而不是随机的。

它将与 Horizo​​ntal Pod Autoscaler 共存。

截至今天,我有一个入口指向我的 NodePort 服务

如果它可以在本地与 minikube 一起工作而不需要在云提供商上就更好了。

如果没有,我将使用 OVH 作为我的 Kubernetes 云提供商。

感谢您提供任何信息

Q: services points to the pods that has the more ram/cpu ressources available

目前 Kubernetes 中没有这样的功能。

但是你可以将 kube-proxy 切换到 ipvs 模式,它允许你使用以下平衡算法:

  • rr: round-robin
  • lc: least connection
  • dh: destination hashing
  • sh: source hashing
  • sed: shortest expected delay
  • nq: never queue

Calico 也 supports 它。