Install a k3s node

On the node

Become root.


sudo su
        

Then update the OS.


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

Login back into the node and become root.


sudo su
        

Disable IPv6 in /etc/sysctl.conf (add the line at the end of the file).


net.ipv6.conf.all.disable_ipv6 = 1
        

Comment out all IPv6 addresses in the /etc/hosts file. The end result should look similar to the content below.


127.0.0.1	localhost
# ::1		localhost ip6-localhost ip6-loopback
# ff02::1	ip6-allnodes
# ff02::2	ip6-allrouters

127.0.1.1	kube0
        

Set the OS to not load IPv6 kernel module.


cat <<EOF > /etc/modprobe.d/ipv6.conf
# Don't load ipv6 by default
alias net-pf-10 off
alias ipv6 off
options ipv6 disable_ipv6=1
EOF
        

Set the firewall to legacy iptables.


update-alternatives --set iptables /usr/sbin/iptables-legacy
        

Reboot the node.


reboot
        

On the machine you are using to manage the cluster

Copy the SSH keys into the node (replace NODE-IP with the IP address of the node).


ssh-copy-id pi@NODE-IP
        

Join the node to the k3s cluster (replace NODE-IP with the IP address of the node and SERVER_IP with the IP address of the master).


k3sup join --ip NODE-IP --server-ip SERVER-IP --user pi
        

And voila you have added a k3s node to your k3s cluster!

Posted February 10th, 2020

Up