
Servercore is a dynamic cloud platform that recently launched its servers in the vibrant city of Nairobi, Kenya. I was attracted by their free coupon offer to experience their cloud resources, so I couldn’t resist exploring their proud unique server specifications, including the Raspberry Pi 4B server.
Servercore: https://servercore.com/
In this guide, we will introduce how to configure the Raspberry Pi 4B on Servercore and smoothly create a powerful Kubernetes cluster. We will navigate the complexities of configuring all necessary elements together, ultimately establishing a fully functional cluster.
For this setup, I will use Rancher Labs’K3s distribution, as it is optimized for ARM servers and works exceptionally well with the Pi. You can also use other distributions likeK0s for the setup.
Prerequisites
1. Have a Servercore account
2. Understand Kubernetes and K3s
Configuring Raspberry Pi 4B
1. Select “Servers” on your main account page
2. Filter results by selecting “MicroSD”
3. Select “Raspberry Pi 4B”
Note: Currently, the Pi is only available in Saint Petersburg.
4. Select the Ubuntu version
Note: You can also add your SSH key
6. View the configured server
7. Get the password by drilling down into the server and selecting the “Operating System” tab
Configuring and Updating Pi 4B
The following steps need to be performed on both the master node and worker nodes
sudo apt update && sudo apt upgrade
It is recommended to disable ufw (uncomplicated firewall):
Install curl and other necessary tools:
sudo apt install curl unzip -y
Since you are using Ubuntu on Raspberry Pi 4B, cgroup is not enabled by default, and you need to enable it manually.
Note: It is not configured in /boot/cmdline.txt.
Configuring cgroup
Edit the cmdline.txt folder
sudo nano /boot/firmware/cmdline.txt
Add the following cgroup settings at the end of the line
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
Reboot the Raspberry Pi node
Installing K3s on the Master Node
Download and run the K3s script
curl -SL https://get.k3s.io | sh -
This will download and start k3s on the management node; you can check by verifying if the nodes are running.
Obtain and copy the join token used to connect the two nodes
sudo cat /var/lib/rancher/k3s/server/node-token
Worker Node
Install k3s and join it to the master node
curl -sfL https://get.k3s.io | K3S_TOKEN="YOUR TOKEN" K3S_URL="https://[your server ip]:6643" K3S_NODE_NAME="servername" sh -
This will download the K3s binary and join it to the master node.
Checking Nodes
Check if the nodes have joined.
The worker node has joined the master node, and we are ready to test our cluster by running an application on the cluster.
Testing the Cluster
Let’s run an NGINX container to check if the cluster is running well
kubectl create deployment nginx-deployment --image=nginx
Check if the Pod is running
We can see that the Pod is running on the worker node. Now let’s expose the application.
kubectl expose deployment nginx-deployment --port=80 --type=NodePort --name=nginx-service

Finally, let’s port-forward the application so we can view it externally from the cluster.
kubectl port-forward deployment/nginx-deployment 8080:80
We can view the running application in the browser
Conclusion
In this blog, we successfully configured a Raspberry Pi 4B cluster on Servercore and set up Kubernetes using K3s.
If you want to inquire about Raspberry Pi standard products and industrial products, feel free to contact us~
1. Scan the QR code to add Engineer Yang for consultation.

2. Send us your contact information via private message, and we will get back to you as soon as possible.
3. Official website of Raspberry Pi distributor Shanghai Jingheng: https://www.edatec.cn/cn
We will update regularly~
Follow Raspberry Pi developers~
Learn more about Raspberry Pi related content~