We needed to test the deployment of K3s and didn’t want to pay/set up a new virtual machine for this. Instead, we chose to deploy K3s inside a free Google Cloud Platform cloud shell.
Use the steps below to run K3s in Cloud Shell:
# Download the K3s binary from Github to Cloud Shell
wget https://github.com/k3s-io/k3s/releases/download/v1.21.1%2Bk3s1/k3s
# Make the binary executable
chmod +x k3s
# Run K3s in the background
sudo ./k3s server --snapshotter native&
Click the button below to clone the Github repo directly into Cloud Shell
After running this script, validate the node is ready
# Check K3s cluster
sudo ./k3s kubectl get nodes