kelseyhightower / kubernetes-the-hard-way

Bootstrap Kubernetes the hard way. No scripts.
Apache License 2.0
41.26k stars 14.12k forks source link

mv: cannot stat 'kube-controller-manager.kubeconfig': No such file or directory #721

Open dsl2022 opened 2 years ago

dsl2022 commented 2 years ago

I am working on the Configure the Kubernetes Controller Manager and I ran

sudo mv kube-controller-manager.kubeconfig /var/lib/kubernetes/

and got the following error

mv: cannot stat 'kube-controller-manager.kubeconfig': No such file or directory

guillaumelauzier commented 1 year ago

This error message indicates that the file kube-controller-manager.kubeconfig could not be found in the current directory. This could be because the file does not exist, or because you are in the wrong directory.

To fix this error, you can try one of the following solutions:

cd /path/to/directory/where/file/should/be ls

If the file is not listed, try creating it

touch kube-controller-manager.kubeconfig

Edit the file to add the required configuration

nano kube-controller-manager.kubeconfig

Once the file is configured, you can try moving it again

sudo mv kube-controller-manager.kubeconfig /var/lib/kubernetes/

melvabout commented 6 months ago

Make sure you have completed step 5. You make the file yourself.

https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/a9cb5f7ba50b3ed496a18a09c273941f80c6375a/docs/05-kubernetes-configuration-files.md?plain=1#L88