Setup: Three virtual machine, with one master and two worker nodes running locally on my computer. I created the cluster via kubeadm. The master is using containerd as CRI and the worker nodes are using cri-dockerd. The worked are joined to master without any problems and show up as “Ready”.
Problem: On each of my worker nodes, there is a /etc/kubernetes/kubelet.conf and /etc/kubernetes/pki/ca.crt. I copied the entire /etc/kubernetes folder to $HOME, renamed the kubelet.conf to config and chown’ed it. I’m trying to run kubectl on my worker nodes but I can’t get it running.
two@node2:~$ kubectl version
Error in configuration:
* unable to read client-cert /var/lib/kubelet/pki/kubelet-client-current.pem for default-auth due to open /var/lib/kubelet/pki/kubelet-client-current.pem: permission denied
* unable to read client-key /var/lib/kubelet/pki/kubelet-client-current.pem for default-auth due to open /var/lib/kubelet/pki/kubelet-client-current.pem: permission denied
Executing this via sudo does not help either. It completely ignores the $HOME config.
two@node2:~$ sudo kubectl version
Client Version: v1.29.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
The connection to the server localhost:8080 was refused - did you specify the right host or port?