Setup k3s on Ubuntu
-
Install k3s as a service
curl -sfL https://get.k3s.io | sh -
-
Fix k3s permission denied issues
mkdir ~/.kube 2> /dev/null export KUBECONFIG=~/.kube/config sudo k3s kubectl config view --raw > "$KUBECONFIG" chmod 600 "$KUBECONFIG"
- More details (opens in a new tab) in fixing k3s permission denied issues.
-
export
KUBECONFIG=~/.kube/config
to either~/.profile
or~/.bashrc
to make it persist on reboot(Optional).nano ~/.bashrc source ~/.bashrc
Navigate to the last line
~/.bashrc# last line export KUBECONFIG=~/.kube/config
-
Test connection
kubectl get all