xzcat ubuntu-19.10.1-preinstalled-server-arm64+raspi3.img.xz | sudo dd of=/dev/disk6 bs=32m`
Boot Raspberry. Headless possibel with Ubuntu image as SSH login enabled by default in image.
$ ssh ubuntu@192.168.1.80
- test login via ssh (ubuntu/ubuntu)
$ ssh-copy-id ubuntu@192.168.1.80
- needed for easier access and k3sup
sudo hostnamectl set-hostname k8srollmaster
hostnamectl set-hostname k8srollmaster
If you want ifconfig
available for checking network interfaces also sudo apt install net-tools
required.
Note: Enabling swap on Kubernetes nodes/master is not generally recommended. However, seems to be ok for k3s. See discussion at kubernetes/kubernetes#53533
Verify if swap file or partition exists sudo swapon --show
or free -ht
.
To create:
sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288 _OR_
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Permanently enable edit fstab sudo vi /etc/fstab
and add
/swapfile swap swap defaults 0 0
Verify again with sudo swapon --show
or free -ht
.
If not enabled (pre-req for Docker) you'll see errors showing in /var/log/syslog
or, respectively when running systemctl status k3s
Dec 26 20:16:34 kuberollmaster systemd[1]: Started Lightweight Kubernetes.
Dec 26 20:16:34 kuberollmaster k3s[2342]: time="2019-12-26T20:16:34.536883337Z" level=fatal msg="failed to find memory cgroup, you may need to add \"cgroup_memory=1 cgroup_enable=memory\" to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)"
Even though in 19.10.1 firmware/README
it reads
usercfg.txt - the file in which user modified configuration should be placed, included by config.txt
the correct file is the same as in 19.10 i.e. /boot/firmware/nobtcmd.txt
to place cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1
Use cat /proc/cmdline
to verify if parameters were passed on to kernel as expected (after reboot).
(see also k3s-io/k3s#1078)
Needs sudo apt install linux-modules-extra-raspi
see https://bugs.launchpad.net/bugs/1947628
k3sup install --ip 192.168.1.80 --user ubuntu
Note: IP configs (fixed IP via DHCP MAC address)
- Master: x.x.x.80
- Nodes: x.x.x.81, x.x.x.x.82
To test:
export KUBECONFIG=`pwd`/kubeconfig
kubectl get node
If kubectl
is not present install e.g. with brew install kubernetes-cli
(MacOS).
See also section "Join some agents to your Kubernetes server" at https://github.com/alexellis/k3sup
k3sup join --ip 192.168.1.81 --server-ip 192.168.1.80 --user ubuntu
- Good hardware list / recommendation: https://www.hanselman.com/blog/HowToBuildAKubernetesClusterWithARMRaspberryPiThenRunNETCoreOnOpenFaas.aspx
Hypriot https://blog.hypriot.com/
...HypriotOS, which is a minimal Debian-based operating systems that is optimized to run Docker. It made it dead easy use Docker on any Raspberry Pi ...