k3s
Deploys a K3s server instance.
Use it on boxctl
- On the dashboard, pick k3s in the Template picker and click Boot box.
- The box boots, then runs
k3s/k3s-server.shon itself. The button reads Booting… until the script has finished. - Open the box's Terminal and follow the guide below. The box's row keeps a link back to this page under the template's name.
The guide is shared with the onctl CLI, so it starts from an onctl up -a k3s/k3s-server.sh command. Booting a box with this template replaces that command; everything the guide runs on the VM itself applies as written.
Rancher k3s installation on-demand
onctl up -n qwe -a k3s/k3s-server.sh --download /tmp/k3s.yaml
This will create the vm, install k3s and download the kubeconfig file to you local. Then;
kubectl --kubeconfig k3s.yaml get po -A
OR
export KUBECONFIG=$PWD/k3s.yaml
to directly set your KUBECONFIG
Adding nodes to k3s
Run the following command to join a vm to k3s cluster.
onctl up -n qwe-node -a k3s/k3s-agent.sh -e SERVER_IP=<IP_OF_SERVER_NODE> -e TOKEN=<TOKEN>
k3s server token is random generated by the server script. which can be found on /tmp/token.
See the template's source for exactly what it runs.