@Mumshad Mannambeth,@Tej_Singh_Rana. Pls, do you have time for help me. As you c . . .

Miroslav Karanovic:
@Mumshad Mannambeth,@Tej_Singh_Rana.
Pls, do you have time for help me.
As you can see I have the problem om master-1&worker-2:
I am try to resolve, but without success…

First the problem occurred on worker-2 node, later when I try to solve it and on master-1 node.
vagrant@worker-2:~$ kubectl create -f bootstrap-token-07401b.yaml
The connection to the server localhost:8080 was refused - did you specify the right host or port?
vagrant@worker-2:~$

vagrant@master-1:~$ kubectl get componentstatuses
The connection to the server localhost:8080 was refused - did you specify the right host or port?
vagrant@master-1:~$ kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?
vagrant@master-1:~$
vagrant@master-1:~$ kubectl get nodes --kubeconfig admin.kubeconfig
The connection to the server 127.0.0.1:6443 was refused - did you specify the right host or port?

If I cannot resolve this I only can destroy the virtual VMs master-1 or that destroy VirtualBox and all uninstall. And I start again …
Tomorrow I can answer only after 4pm CET time zone, if anyone is interested to help…
Maybe, anyone can to help me to connect with Teamviewer and resolve this cause…
I would be very grateful…

Tej_Singh_Rana:
Hello, @Miroslav Karanovic
Please perform following steps on master node:

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Reference:
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#more-information

Tej_Singh_Rana:
Demo videos also available in YT channel:
https://youtu.be/uUupRagM7m0?list=PL2We04F3Y_41jYdadX55fdJplDvgNGENo

Miroslav Karanovic:
Hi @Tej_Singh_Rana,

as you can see it don’t help me. I am try it before…

vagrant@master-1:~$ mkdir -p $HOME/.kube
vagrant@master-1:~$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
cp: cannot stat ‘/etc/kubernetes/admin.conf’: No such file or directory
vagrant@master-1:~$ sudo chown $(id -u):$(id -g) $HOME/.kube/config
vagrant@master-1:~$

Also, I watch on youtube video. Only, I can destroy this all…

Miroslav Karanovic:
Hi @Tej_Singh_Rana,

as you can see it don’t help me. I am try it before…

vagrant@master-1:~$ mkdir -p $HOME/.kube
vagrant@master-1:~$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
cp: cannot stat ‘/etc/kubernetes/admin.conf’: No such file or directory
vagrant@master-1:~$ sudo chown $(id -u):$(id -g) $HOME/.kube/config
vagrant@master-1:~$

Also, I watch this on youtube video. Only, I can destroy this all…

Miroslav Karanovic:
Many thanks for your answer above…

Tej_Singh_Rana:
Above method will work when you setup a cluster through the kubeadm tool.

Tej_Singh_Rana:
You have to run this command from master-1 node, not from worker-2 node.
> kubectl create -f bootstrap-token-07401b.yaml

@kodekloud , I was setup correctly. And copy /etc/kubernetes/admin.conf to ~/.kube/config. And another two setup but not type “kubectl get pod or nodes”. What’s my issue?