Sunday, December 22, 2019

My complete steps to join a new Raspberry Pi 4 node running Ubuntu 19.10 to the cluster

Connect the micro-hdmi, keyboard, and power.

Wait for it to boot up.

Login. Default user/pass is ubuntu/ubuntu, but it will make you change it on first login.

sudo apt update
sudo apt upgrade

Change the hostname, edit /etc/hostname

Enable the boot cmdline groups, edit /boot/firmware/nobtcmd.txt and add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to the end of the existing line (do not add newlines)

Reboot. Log in again.

Run ssh-keygen

From the master node:

copy over ssh key from master to the new node, just to make things easier:

ssh-copy-id nodehostname

copy over the node token from the master so that the new node can join the cluster:

scp /var/lib/rancher/k3s/server/node-token ubuntu@nodehostname:.

Now, back on the new node...

export K3S_TOKEN=$(cat node-token)
export K3S_URL=https://masterhostname:6443
curl -sfL https://get.k3s.io | sh -

Watch the logs, but the final message should be something like

systemd: Starting k3s-agent

Back on the master, run

sudo kubectl get nodes
And make sure the new one joined. That's it

Saturday, December 21, 2019

K3s on Raspberry Pi 4 4GB / Ubuntu 19.10 / Arm64

Picking this back up again, now that the USB bug with a >3GB of memory has been fixed in the latest version of Ubuntu 19.10.

Installing K3s is pretty easy, but there is one gotcha that isn't terribly well documented anywhere that I could find.

You need to enable cgroups for cpu and memory. To do that on Ubuntu 19.10 on a Raspberry Pi, edit /boot/firmware/nobtcmd.txt and add the following to the end of the existing line:

cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1

Reboot. Then install K3s