Cheatography
https://cheatography.com
Common commands to work with a k3s cluster in a home lab.
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Installation Raspberry Pi Ubuntu Server 64-bit
1. install control plane/master |
controller1$: curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--tls-san 192.168.1.10 --node-taint CriticalAddonsOnly=true:NoExecute" sh - |
2. generate a k3s token |
controller1$: sudo cat /var/lib/rancher/k3s/server/node-token > node-token.txt |
3. ssh into worker[x] copy token |
|
4. install worker and join controller |
worker1$: curl -sfL https://get.k3s.io | \ K3S_URL=https://192.168.1.7:6443 \ K3S_TOKEN=$(cat /tmp/node-token.txt) \ sh - |
5. check node installed and in 'Ready' state |
controller$: kubectl get nodes |
Repeat Step 3 for every worker |
|
|
Change IP Address of K3S nodes
Remove any containers in the node |
controller1$: kubectl drain worker1 --ignore-daemonsets --delete-emptydir-data |
Remove the node from controller |
controller1$: kubectl delete node worker1 |
Stop the worker k3s |
worker1$: sudo systemctl stop k3s-agent |
cleanup |
worker$: sudo rm -rf /etc/rancher /var/lib/rancher |
Regular Install steps |
Add on Additional Control Plane / Master
|
|
|