- Setup server node
- Setup agent node
$ curl -sfL https://get.k3s.io | sh -
Check for Ready node, takes maybe 30 seconds.
$ k3s kubectl get node
Then, get token from server node, this will used by agent node.
$ sudo cat /var/lib/rancher/k3s/server/node-token
- Add k3s server ip to /etc/hosts file.
$ sudo su
$ echo "192.168.55.130 k3s-m" >> /etc/hosts
$ exit
- Install agent, this will used the token which get from previous step.
$ curl -sfL https://get.k3s.io |K3S_URL=https://k3s-m:6443 K3S_TOKEN=XXXXXXXXXX sh -
- After installed, check the state on server node.
$ sudo k3s kubectl get nodes
NAME STATUS ROLES AGE VERSION
k3s-m Ready master 164m v1.18.4+k3s1
k3s-s1 Ready <none> 17m v1.18.4+k3s1
- Server node:
k3s-killall.sh
- Agent node:
k3s-agent-uninstall.sh