$ kubectl config get-contexts
returns nothing on node01 in the cluster. I went as far as to set the password on the master node and then ran $ sudo scp -i master@172.17.0.133:/etc/kubernetes/admin.conf ~/.kube/config
, but got permission denied. How do I get this working?
Here are the steps I followed in order to make it work:
sudo su
on Node01 and change the password to one of your liking
sudo scp /root/admin.conf root@Node01IP:/root/
(you can use Node01 instead of IP)
on Node01:
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf
Run kubectl get nodes
or kubectl config get-contexts
or any kubectl command to verify.