I have cloned the k8 official repository from here and built the binaries kubectl, kubeadm, and kubelet. And I have exported the binaries directory into the $PATH system variable and have also edited the .bashrc profile as shown below:
suraj@suraj-lab:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/suraj/projects/kubernetes/_output/dockerized/bin/linux/amd64
The snippet of cat .bashrc
when i hit the command kubeadm init
, it says the command is not run with sudo privileges. However when i hit the sudo kubeadm init
it says sudo: kubeadm: command not found
. I checked running kubectl version
, kubelet version
, and kubeadm version
, all of them give the expected output. could somebody please help me what’s getting wrong here ? i mean why i am not able to run the kubeadm with the sudo
prefix?
One workaround is, if i paste the full path of kubeadm binaries it works as shown below: