This user has no kubeconfig
CommonThe cluster exists but this user's ~/.kube/config does not. After kubeadm init, admin.conf stays in /etc/kubernetes until someone copies it, as kubeadm's output instructs. A new laptop, a new CI runner or a fresh container is the same situation.
Confirm
kubectl config view && ls -l ~/.kube/config
clusters: null, and No such file or directory for ~/.kube/config
Fix
- On a kubeadm control-plane node, copy admin.conf into your home directory as kubeadm's own instructions show, then confirm with kubectl get nodes.
- For a managed cluster, write the kubeconfig with the provider's CLI, for example aws eks update-kubeconfig, gcloud container clusters get-credentials or az aks get-credentials.
- Otherwise ask the cluster's administrator for a kubeconfig with the access you need, rather than admin.conf.
mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config kubectl get nodes
The commands kubeadm init prints for a regular user. admin.conf grants cluster-admin; use it only for people who should have that.