使用 Parallels RAS 或 NGINX 进行 kubernetes 负载平衡

问题描述

也许我在追求在本地网络上创建接近真实的 Kubernetes 设置的过程中还有很长的路要走 :-)

是否可以使用 Parallels(Desktop) RAS 作为 Kubernetes 的负载均衡器?

1. I am running a master node in Ubuntu on Parallels Desktop 
2. And some worker nodes also in Parallels Desktop

两者都使用桥接网络。

如果可以设置包含 LoadBalancer 的设置就好了。

解决方法

您可以使用 MetalLBKubeVIPKeepalived-operator(使用 HAProxy)。我玩过 KubeVIP,但现在在基于 RasberryPi 的 Kubernetes 集群中使用 MetalLB L2。如果您有支持该协议的路由器(例如 Unifi),MetalLB BGP 会更好。以下参考资料可能会有所帮助:

  1. https://www.openshift.com/blog/self-hosted-load-balancer-for-openshift-an-operator-based-approach
  2. https://www.youtube.com/watch?v=9PLw1xalcYA
  3. http://blog.cowger.us/2019/02/10/using-metallb-with-the-unifi-usg-for-in-home-kubernetes-loadbalancer-services.html