Unfortunately I lost my local
~/.kube/config
where I had configuration for my namespace.
Is there a way to get this config if I have access to master nodes?
Thanks in advance
I believe you're using kubeadm to start your kubernetes cluster, you can generate the new kubeconfig file using following command:
kubeadm alpha phase kubeconfig admin --kubeconfig-dir /etc/kubernetes --cert-dir /etc/kubernetes/pki
This will generate a new config file in /etc/kubernetes/admin.conf
. Then you can copy the file in following way:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With