Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Not able to configure Kubectl. #886

Closed
vmudigal opened this issue Jun 7, 2017 · 3 comments
Closed

Not able to configure Kubectl. #886

vmudigal opened this issue Jun 7, 2017 · 3 comments

Comments

@vmudigal
Copy link

vmudigal commented Jun 7, 2017

I refered https://coreos.com/kubernetes/docs/latest/kubernetes-on-vagrant-single.html

I am not able to configure kubectl.

Use a custom KUBECONFIG path
$ kubectl config use-context vagrant-single

error: open /Users/vmudigal/coreos-kubernetes/single-node/kubeconfig.lock: file exists

vmudigal$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.1", GitCommit:"b0b7a323cc5a4a2019b2e9520c21c7830b7f708e", GitTreeState:"clean", BuildDate:"2017-04-03T20:44:38Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"darwin/amd64"}
The connection to the server 172.17.4.99:443 was refused - did you specify the right host or port?

@dannymk
Copy link

dannymk commented Jun 12, 2017

How about removing the lock file first?
mv /Users/vmudigal/coreos-kubernetes/single-node/kubeconfig.lock /Users/vmudigal/coreos-kubernetes/single-node/kubeconfig.lock.old

@obriensystems
Copy link

Tried moving the file - but the error is a secondary exception - because kubeconfig.lock is either a transient file during the transaction or it does not exist

obrienbiometrics:single-node michaelobrien$ kubectl config use-context vagrant-single
error: open /Users/michaelobrien/wse_onap/coreos/coreos-kubernetes/single-node/kubeconfig.lock: file exists

obrienbiometrics:single-node michaelobrien$ pwd
/Users/michaelobrien/wse_onap/coreos/coreos-kubernetes/single-node
obrienbiometrics:single-node michaelobrien$ mv kubeconfig.lock kubeconfig.lock.old
mv: rename kubeconfig.lock to kubeconfig.lock.old: No such file or directory
obrienbiometrics:single-node michaelobrien$ ls -la
total 104
drwxr-xr-x 11 michaelobrien staff 374 29 Jun 16:16 .
drwxr-xr-x 16 michaelobrien staff 544 29 Jun 15:24 ..
-rw-r--r-- 1 michaelobrien staff 14 29 Jun 15:24 .gitignore
drwxr-xr-x 3 michaelobrien staff 102 29 Jun 15:50 .vagrant
-rw-r--r-- 1 michaelobrien staff 297 29 Jun 15:24 README.md
-rw-r--r-- 1 michaelobrien staff 2345 29 Jun 15:24 Vagrantfile
-rwxr-xr-x 1 michaelobrien staff 318 29 Jun 15:24 conformance-test.sh
-rw-r--r-- 1 michaelobrien staff 437 29 Jun 15:24 kubeconfig
drwxr-xr-x 5 michaelobrien staff 170 29 Jun 15:58 oom
drwxr-xr-x 15 michaelobrien staff 510 29 Jun 15:50 ssl
-rw-r--r-- 1 michaelobrien staff 31944 29 Jun 15:24 user-data

@obriensystems
Copy link

The fix is actually to wait until the VM is fully initialized

obrienbiometrics:single-node michaelobrien$ kubectl config use-context vagrant-single
Switched to context "vagrant-single".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants