kube-prompt icon indicating copy to clipboard operation
kube-prompt copied to clipboard

panic: invalid configuration: no configuration has been provided

Open ludovicc opened this issue 6 years ago • 4 comments

Hello, I trying kube-prompt with microk8s on Ubuntu 18.04.

I installed microk8s using the following commands:

sudo snap install microk8s --classic
sudo snap alias microk8s.kubectl kubectl

kube-prompt seems to work well, until you invoke a 'describe no' command

>>> get nodes
NAME       STATUS   ROLES    AGE     VERSION
hos54985   Ready    <none>   6h22m   v1.14.2
>>> describe no panic: invalid configuration: no configuration has been provided

goroutine 9 [running]:
github.com/c-bata/kube-prompt/kube.NewClient(0x114f6ff)
	/build/go/src/github.com/c-bata/kube-prompt/kube/client.go:28 +0x1ad
github.com/c-bata/kube-prompt/kube.getClient(...)
	/build/go/src/github.com/c-bata/kube-prompt/kube/client.go:15
github.com/c-bata/kube-prompt/kube.fetchNodeList()
	/build/go/src/github.com/c-bata/kube-prompt/kube/resource.go:464 +0x114
created by github.com/c-bata/kube-prompt/kube.getNodeSuggestions
	/build/go/src/github.com/c-bata/kube-prompt/kube/resource.go:470 +0x39

Do you have any idea for how to fix this issue? Thanks

ludovicc avatar Jun 17 '19 15:06 ludovicc

Update: running the following command seems to provide a work-around:

  microk8s.kubectl config view --raw > $HOME/.kube/config

ludovicc avatar Jun 17 '19 15:06 ludovicc

Hey @ludovicc how is it possible that you were able to launch kube-prompt without the kubeconfig file? I was trying to reproduce the problem but I am already getting error invalid configuration: no configuration has been provided when launching kube-prompt.

mic4ael avatar Mar 05 '20 18:03 mic4ael

I cannot remember that detail... I did a fresh install of microk8s on my machine, then launched kube-prompt and it seemed to work at first. Now it seems that kube-prompt complains with an error message, which is good. The error message could be improved, for example 'error invalid configuration: no Kubernetes configuration found at ~/.kube/config'

ludovicc avatar Mar 09 '20 15:03 ludovicc

I guess this issue can be then closed ;)

mic4ael avatar Mar 16 '20 06:03 mic4ael