Scaling a Kubernetes cluster can seem daunting, but MicroK8s1 makes it surprisingly easy. Recently, we needed to add a new node to our existing cluster, and by following a few simple steps, we did it with no hiccups. This process2 ensures your cluster is prepared for increased workloads or resources. Below is a breakdown of how we connected the new node to the cluster and verified its successful integration.
How we added a node
Recently, we needed to expand our Kubernetes cluster by adding a new node using MicroK8s. Here’s the process we followed.
Retrieve the join command
On the existing node, we used:
sudo microk8s add-node
This command generated a unique token and command to add the new node.
Execute join on the new node
On the new node, we ran the generated join command:
sudo microk8s join 192.168.111.10:25000/bc0a26a93154173c7247c9b20175c52b/b79091d48c89
This connected the node to the cluster.
Verify the node addition
Finally, we confirmed the new node was part of the cluster with:
kubectl get nodes
The node appeared in the list, confirming its successful addition.
Summary
By following these steps, we were able to smoothly add a node to our Kubernetes cluster using MicroK8s. Whether you're expanding resources or preparing for more workloads, this method ensures your new node integrates seamlessly without disruptions. It’s a simple, effective process that can be easily repeated whenever your cluster needs scaling.