adamant-kite-43734
11/20/2023, 2:02 PMbored-farmer-36655
11/20/2023, 2:19 PMkubectl get nodes
brave-afternoon-4801
11/20/2023, 2:25 PMexport INSTALL_K3S_BIN_DIR=/usr/bin
k3s-install
bored-farmer-36655
11/20/2023, 2:25 PM@kermit:~> which kubectl
/usr/local/bin/kubectl
@kermit:~> kubectl --kubeconfig=/etc/rancher/k3s/k3s.yaml get nodes
NAME STATUS ROLES AGE VERSION
kermit Ready control-plane,master 48d v1.26.9+k3s1
brave-afternoon-4801
11/20/2023, 2:27 PMswift-pillow-85929
11/20/2023, 2:46 PMlate-needle-80860
11/20/2023, 6:58 PMswift-pillow-85929
11/20/2023, 7:05 PMbrave-afternoon-4801
11/20/2023, 7:17 PMno it wasn't, this is why i was asking weird thingsLet me just break it down.
PATH
is how your shell searches for binaries. when you are running as your unprivileged user, PATH
must have /usr/bin/local
in it. You can see the difference with the following commands:
echo $PATH
sudo $SHELL -c 'echo $PATH'
brave-afternoon-4801
11/20/2023, 7:21 PMsudo -i
, which will set up the full shell for you, and likely have PATH configured as you need.swift-pillow-85929
11/20/2023, 7:21 PM/usr/local/bin
in the path, this is why the error is very strange.brave-afternoon-4801
11/20/2023, 7:21 PMbrave-afternoon-4801
11/20/2023, 7:21 PMbrave-afternoon-4801
11/20/2023, 7:23 PMso far looks like i missed something on initial k3s setup, since my k3s.yml has too restrictive permissions.You didn't do anything wrong. The permissions should be restrictive. I suggest at least 600. 644 is dangerous. All you need to do is look up the instructions for your distribution for making sure
/usr/local/bin
is always in PATH. Or you could use the environment variable I gave you above, which will install your binaries into /usr/bin
which is guaranteed to be in all PATHs, no config or insecure permissions neededbrave-afternoon-4801
11/20/2023, 7:24 PMINSTALL_K3S_BIN_DIR=/usr/bin
when you are installingbrave-afternoon-4801
11/20/2023, 7:26 PMswift-pillow-85929
11/20/2023, 7:31 PMINSTALL_K3S_BIN_DIR
.
tonight i'll undo what i did on that vm and try again.brave-afternoon-4801
11/20/2023, 7:31 PM