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
if you are on windows system. try to run command as administrator.
this fix error. open .lock: access is 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/