K3s Installation steps
Step1. create database named “k3s” in mariadb server and grant user permissions.
Step2. Install ubuntu to all “Pi” and assign IP address for each device.
Step3. Shell into node if hardware is Raspberry Pi.
# sudo echo cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 >> /boot/cmdline.txt
Step4. Change hostname for each device, K3S is using hostname be cluster node name.
# hostnamectl set-hostname <k3s_node_name_you_define>
Step5. Shell into each node and run K3S installation command one by one.
# curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC=”–write-kubeconfig-mode 644 –token yourk3stoken –tls-san k3s.myproject.com sh -s – –datastore-endpoint=”mysql://db_user_name:[email protected](192.168.0.10:3306)/k3s”
Step6. Following command to verify all nodes joined status.
# kubectl get nodes
That’s it. K3S cluster is ready, The installation was extremely easy ! It’s shows all nodes are running in “control-plan,master” roles.