c-bata / kube-prompt

An interactive kubernetes client featuring auto-complete.
MIT License
1.78k stars 133 forks source link

panic: invalid configuration: no configuration has been provided #54

Open ludovicc opened 5 years ago

ludovicc commented 5 years ago

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

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

  microk8s.kubectl config view --raw > $HOME/.kube/config
mic4ael commented 4 years ago

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.

ludovicc commented 4 years ago

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'

mic4ael commented 4 years ago

I guess this issue can be then closed ;)