Multi-node, highly available Kubernetes with MicroK8s
To create a cluster out of two or more already-running MicroK8s instances, use the microk8s add-node command. As of MicroK8s 1.19, clustering of three or more nodes will automatically enable high availability.
The MicroK8s instance on which the command is run will host the Kubernetes control plane:
microk8s add-node
The add-node command prints a microk8s join command which should be executed on the MicroK8s instance(s) that you wish to join to the cluster (NOT THE NODE YOU RAN add-node FROM). For example:
microk8s join ip-172-31-20-243:25000/DDOkUupkmaBezNnMheTBqFYHLWINGDbf
Joining a node to the cluster should only take a few seconds. Afterwards you should be able to see the node has joined:
microk8s kubectl get no