0

When I run k3s kubectl version

$ k3s kubectl version
W0730 19:46:32.066086   17273 loader.go:222] Config not found: /home/ecarroll/.kube/config
[...]
The connection to the server localhost:8080 was refused - did you specify the right host or port?

How can I fix this problem?

1 Answer 1

0

This is another error message relate to your kubectl config. In this case you likely have an environmental variable KUBECONFIG pointing to a location that doesn't exist.

First confirm this is set to the same location above that didn't exist

echo $KUBECONFIG

If it's already set, simply regenerate a kubeconfig for k3s with

mkdir ~/.kube 2> /dev/null
sudo k3s kubectl config view --raw > "$KUBECONFIG"
chmod 600 "$KUBECONFIG"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.