!!! note This post is a thought. It's a short note that I make about someone else's content online. Learn more about the process here

Here's my thought on 💭 Can I access k3s using just kubectl (no sudo and no k3s command) : kubernetes

Right after installing k3s you are going to need to use sudo to use any kubectl command. The reason for this is that the default config is owned by root. To get around this you will need to make your own config and set the KUBECONFIG environment variable

To do this I used sudo one last time to copy the k3s.yaml file into my own directory and take ownership of it.

sudo cp /etc/rancher/k3s/k3s.yaml /home/waylon/.config/kube

sudo chown -R waylon:waylon ~/.config/kube

export KUBECONFIG=~/.config/kube/k3s.yaml

This post was a thought by Waylon Walker see all my thoughts at https://waylonwalker.com/thoughts