Following this tutorial, I set up a worker node for my cluster. However, after running the join command and attempting kubectl get node to verify the node was connected, I am met with the following error
W0215 17:58:44.648813 3084402 loader.go:223] Config not found: /etc/kubernetes/admin.conf
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Checking for the existence of admin.conf in /etc/kubernetes/ shows it does not exist. I have ensured that $HOME/.kube/config is also clear. Why is the join command not creating an admin.conf file?
TLDR
joinwith sudomv /etc/kubernetes/kubelet.conf /etc/kubernetes/admin.confAfter some tinkering, I realized it was a combination of a permissions error and the correct file being generated with an incorrect name.
Instead of running
kubeadm join ...naked, running with sudo allowed for the command to create files necessary in/etc/kubernetesHowever this doesn't generate an
admin.conf, but does create akubelet.conf. I'm unsure why this happens, and couldn't find any documentation on this behavior, however runningkubectlwith the following parameter solved my issueRename
kubelet.conftoadmin.conffor your convenience at this point.