Back
Sat Apr 13 2024
Adding a node to your cluster

Lets say that you have a MicroK8s cluster that consists of one main node (machine A) with the IP address 192.168.1.49 and you want to add a node (machine B) with the 192.168.1.50.


Prerequisites:

  • install ubuntu server on both nodes
  • install microk8s on both nodes

To add a node to your cluster, you'll need run the following command on your main node (machine A).

# in machine A
microk8s add-node

From the node you wish to join to this cluster, run the following:
microk8s join 192.168.1.49:25000/a96864cd05756441054e225a1c1845d4/920f7657461d

Use the '--worker' flag to join a node as a worker not running the control plane, eg:
microk8s join 192.168.1.49:25000/a96864cd05756441054e225a1c1845d4/920f7657461d --worker

If the node you are adding is not reachable through the default interface you can use one of the following:
microk8s join 192.168.1.49:25000/a96864cd05756441054e225a1c1845d4/920f7657461d

NOTE: Worker nodes do not have a Kubernetes Control Plane (KCP) which means that they are only intended to run workloads (grunt work) and not to handle tasks that require KCP-level logic like certificate issuance, ingress logic or something of that caliber (source).

Then, in your new node (machine b), you'll need to run the following command.

microk8s join 192.168.1.49:25000/a96864cd05756441054e225a1c1845d4/920f7657461d

###Failed to add node

Connection failed. The hostname (machineB) of the joining node does not resolve to the IP "192.168.1.50". Refusing join (400).

If you ever get the error above, then your main node is failing to resolve the IP address 192.168.1.50 to the hostname machineB. In order to resolve this, you'll have to perform the following steps on the main node (source):

# add the following line and save
sudo echo "192.168.1.50 machineB" >> /etc/hosts

# alternatively, enter the hosts file and add "192.168.1.50 machineB"
sudo nano /etc/hosts
EmailGithub
oliver © 2026   👋