Install a k3s cluster

On the master

Become root.


sudo su
        

Then update the OS.


apt-get update -y
apt-get upgrade -y
reboot
        

Login back into the master and become root.


sudo su
        

Add the following to /boot/cmdline.txt.


cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
        

Reboot the master.


reboot
        

Log back into the master and become root.


sudo su            
        

On the machine you are using to manage the cluster

Copy the SSH keys into the master (replace MASTER-IP with the IP address of the master).


ssh-copy-id pi@MASTER-IP
        

Install the k3s server.

            
k3sup install --ip <master-ip> --user pi --k3s-extra-args '--no-deploy traefik'
        

Note the command line above excludes Traefik from the deployment as I deploy it separately. If you do not want to configure Traefik yourself feel free to drop the --k3s-extra-args entirely.

Posted February 1st, 2021

Up