$ sudo snap install k9s
$ k9s
Boom!! The specified context does not exists in kubeconfig
$ k9s --context mycontext
Boom!! The specified contextmycontext does not exists in kubeconfig.
ubuntu 18.10
Running the same version from releases works correctly.
@accountgit can you please try the edge release?
sudo snap install k9s --edge
Thanks!
Seems it's not fixed yet. Tried with parameter context and without it.
$ grep -i current .kube/config
current-context: mycontext
$ k9s version
____ __.________
| |/ _/ __ ______
| < ____ / ___/
| | \ / /___ \
|____|__ \ /____//____ >
\/ \/
Version: 0.5.1
Commit: c45214b0fed79a49acb69862feab84e1d289f8c8
Date: 2019-04-19T01:28:16Z
$ k9s --context mycontext
Boom!! The specified context `mycontext does not exists in kubeconfig.
$ k9s
Boom!! The specified context ` does not exists in kubeconfig.
Not sure why but appears a backtick before the context.
@accountgit Rats! I think k9s snap is getting sandboxed and hence can't read from .kube dir. I thought pushing an edge version would have helped here. I've pushed a request to the snap folks to loosen up strict mode but haven't heard back ;(
Unfortunately I am not super versed with snapcraft, Could you try setting KUBECONFIG env var, I don't think it will work but perhaps we can gather another clue? Another thought could be cp your .kube to /tmp and point k9s to it via --kubeconfig /tmp/.kube. I think both of these might be duds but perhaps can shade some light??
If we have here some snapcraft versed folks, I sure could use some help on this... Thank you!
@accountgit Looks to me k9s edge is working fine on ubuntu?
snap install k9s --edge --devmode
k9s
# All good!
Installed and ran without that parameters and don't work either but I managed to make it work using
k9s --kubeconfig .kube/config
edge: 0.5.1 2019-04-19 (99) 9MB devmode
installed: 0.5.1 (99) 9MB devmode
$ k9s --kubeconfig .kube/config.
Maybe you have some environment value set that I don't have?
With the logLevel parameter can't see any more output to help debugging.
Just searched some more information about the issue, seems the problem cames from the confinement of snaps, which devmode bypasses.
The correct way of storing config seems using specific paths from environment variables, not hardcoding them.
I think the change should be checking in internal/config/helpers.go in function mustK9sHome to use SNAP_USER_DATA if the snap variables are defined, and if then use them, otherwise the current information.
I took the information from https://askubuntu.com/questions/762354/where-can-ubuntu-snaps-write-data.
In my case there is a problem too with accessing minikube configuration.
I looked in the goreleaser.yml and seems that you didn't enabled personal files privileges.
Could be added with the .minikube too ? This will make it work I think.
The info came from https://forum.snapcraft.io/t/the-personal-files-interface/9357
Using devmode will workaround but according to documentation but:
" Devmode snaps cannot be released to the stable channel, do not appear in search results, and do not automatically refresh. "
https://docs.snapcraft.io/snap-confinement/6233
I think the same will need to applied to popeye.
@accountgit Thank you so much for this research! I have been in discussions with the snapcraft folks so they can allow K9s and Popeye to read the kube config which I think is the main issue here. This process is going very slow. I am hopeful that they will enable this soon so we can release both projects as stable revs. My understanding is as a snap $HOME is being remapped so I don't think anything special need to be done for the config files. I think the main blocker here is the inability for K9s and Popeye to read K8s home configs once this is enabled we should be ok on the snap front or at least that's the hope...
Could be added the .minikube directory, the same as .kube? For testing things minikube it's a good option.
I managed to make it work using
k9s --kubeconfig .kube/config
Did not work for me:
Boom!! Invalid configuration. Unable to connect to api.
In this case my default context is set to Microk8s, also installed as a snap, so it is not an issue for example with an authentication helper program.
@accountgit @jglick Would you mind giving linuxbrew a rinse with k9 v0.7.13? I am having a really rough time getting thru the snapcraft folks and homebrew just worked perfectly for me on an linux vm. Thank you!!
I will take a pass鈥攄pkg/APT plus Snap is enough for me to keep track of without adding a third tool.
@jglick I totally get this. Managing the cognitive overload is indeed a challenge for all of us. You can always download the release from the releases page. I'll try to get this snapcraft issue as quickly as I can, but unfortunately it's not up to me to speed up this process.
snap install --classic?
https://ubuntu.com/blog/how-to-snap-introducing-classic-confinement
Is there a way to install k9s without using a snap? This issue's driving me mad
Got it, there's an executable in the .tar.gz for linux, dropped that in a bin folder - simples :+1:
Most helpful comment
Installed and ran without that parameters and don't work either but I managed to make it work using
k9s --kubeconfig .kube/config
edge: 0.5.1 2019-04-19 (99) 9MB devmode
installed: 0.5.1 (99) 9MB devmode
$ k9s --kubeconfig .kube/config.
Maybe you have some environment value set that I don't have?
With the logLevel parameter can't see any more output to help debugging.