I try to change default context in kubernetes but I get config.lock: permission denied
error.
$ kubectl config set-context $(kubectl config current-context) --namespace=custom_namespace
error: open /home/vagrant/.kube/config.lock: permission denied
Make sure that kubernetes config directory
has the same permissions as kubernetes config file
.
Solution Beside, steps specified in kubernetes documentation.
$ mkdir -p $HOME/.kube
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
$ sudo chown $(id -u):$(id -g) $HOME/.kube/config
Add change permissions on $HOME/.kube/
directory.
$ sudo chown $(id -u):$(id -g) $HOME/.kube/
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