coreos / coreos-kubernetes

CoreOS Container Linux+Kubernetes documentation & Vagrant installers
https://coreos.com/kubernetes/docs/latest/
Apache License 2.0
1.1k stars 465 forks source link

Not able to configure Kubectl. #886

Closed vmudigal closed 7 years ago

vmudigal commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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".