canonical / microk8s

MicroK8s is a small, fast, single-package Kubernetes for datacenters and the edge.
https://microk8s.io
Apache License 2.0
8.4k stars 767 forks source link

How to configure Control Plane Load Balancer #4386

Open zerowebcorp opened 7 months ago

zerowebcorp commented 7 months ago

Hello, I've checked the documentation on how to setup ha with microk8s. However I am not finding anything that explains the additional steps to do in order to put a load balancer ( I am using an azure load balancer) in front of the 3 VMs where microk8s is installed on HA mode so that I when I run microk8s add-node I get the IP address of the load balancer instead of the node's ip where I executed the command so that the worker nodes use it to connect to one of the 3 manager nodes.

neoaggelos commented 7 months ago

Hi @zerowebcorp, pasting my response from a similar Slack thread this week:

Using a LoadBalancer service for the control plane is a chicken-egg problem, therefore it is typically not recommended

Most often, you need to setup a load balancer that proxies requests to the control plane nodes. The way to do this varies by cloud. The common step is to make sure that the loadbalancer IP or DNS is added as a SAN in the kube-apiserver certificates (see https://microk8s.io/docs/services-and-ports) for details.

Solutions include: