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
        

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 master.


reboot
        

Log back into the master and become root.


sudo su            
        

Install the k3s server.

            
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--no-deploy traefik" sh -
        

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 INSTALL_K3S_EXEC parameter altogether.

Now verify if it all works


kubectl get nodes
        

Posted February 12th, 2020

Up