Step-by-step guide to Add Nodes MicroK8s on Raspberry Pi with Ubuntu 20.04. Our Kubernetes support team is always here to help you.
How to Add Nodes in MicroK8s on Raspberry Pi
If you’re running MicroK8s on Raspberry Pi and looking to scale your cluster, this post on autoscaling walks you through how to Add Nodes MicroK8s step-by-step. Adding new nodes increases compute power and brings redundancy, making your Kubernetes cluster more reliable and available.
Here’s how to add a Raspberry Pi (RPi) node running Ubuntu 20.04 to your existing MicroK8s cluster.
An Overview
Step 1: Generate Join Command on Main Node
Start by connecting to the main RPi node (the control plane) and run:
ubuntu@ubuntu:~$ microk8s add-node
Join node with: microk8s join 192.168.178.66:25000/ipySurdsIOGAlYyYQzzOOSlpUTEDNGfk
If the node you are adding is not reachable through the default interface you can use one of the following:
microk8s join 192.168.178.66:25000/ipySurdsIOGAlYyYQzzOOSlpUTEDNGfk
microk8s join 10.1.79.0:25000/ipySurdsIOGAlYyYQzzOOSlpUTEDNGfk
microk8s join 172.17.0.1:25000/ipySurdsIOGAlYyYQzzOOSlpUTEDNGfk
Copy Code
This command outputs a join token unique to your cluster.
Step 2: Prepare the New Node
Before you Add Nodes MicroK8s, ensure MicroK8s is installed on the second Raspberry Pi and update the hostname:
- Edit /etc/hostname and give it a unique name (e.g., ubuntu-2)
- Edit /etc/hosts and update the hostname accordingly
- Reboot:
sudo reboot
Copy Code
Step 3: Join the Cluster
Now SSH into the second RPi and run the join command from Step 1:
ubuntu@ubuntu-2:~$ microk8s join 192.168.178.66:25000/ipySurdsIOGAlYyYQzzOOSlpUTEDNGfk
Copy Code
Check the node status from the main node:
ubuntu@ubuntu:~$ microk8s.kubectl get nodes
NAME STATUS ROLES AGE VERSION
ubuntu Ready <none> 59d v1.18.3
ubuntu-2 NotReady <none> 98s v1.18.3
Copy Code
If you see NotReady, the memory cgroup is likely disabled or you may encounter an error occurred forwarding.
Step 4: Enable cgroup Memory Support
Check current cgroup status:
ubuntu@ubuntu-2:~$ sudo cat /proc/cgroups
Copy Code
Look for this line:
memory 0 56 0
Copy Code
To fix it, edit the boot config file:
sudo nano /boot/firmware/cmdline.txt
Copy Code
Add the following at the end of the line:
cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
Copy Code
Reboot the node:
ubuntu@ubuntu-2:~$ sudo reboot
Copy Code
After reboot, verify the fix:
ubuntu@ubuntu-2:~$ cat /proc/cgroups
Copy Code
You should now see:
memory 9 101 1
Copy Code
Step 5: Confirm Cluster Status
Back on the main node, check again: https://bobcares.com/blog/kubernetes-cronjob-resource-limits/
ubuntu@ubuntu:~$ microk8s.kubectl get nodes
NAME STATUS ROLES AGE VERSION
ubuntu Ready <none> 59d v1.18.3
ubuntu-2 Ready <none> 4h12m v1.18.3
Copy Code
Summary
To Add Nodes MicroK8s, follow these steps:
- Run microk8s add-node on the main node.
- Configure and rename your new node.
- Run microk8s join with the token.
- Enable memory cgroups.
- Reboot and verify.
[If needed, Our team is available 24/7 for additional assistance.]
Conclusion
This method works perfectly with Raspberry Pi setups and Ubuntu 20.04. Now you can scale confidently with MicroK8s!
Add Nodes MicroK8s is simple, effective, and powerful when you get the details right.
0 Comments