Cannot configure context/ get kubectl working on node01 at Katacoda playground

174 Views Asked by At

$ 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 [email protected]:/etc/kubernetes/admin.conf ~/.kube/config, but got permission denied. How do I get this working?

1

There are 1 best solutions below

0
On

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.