
Describe the bug
A clear and concise description of what the bug is.
22:21:56 θ67° [rolf:~] $ snap info k9s
name: k9s
summary: K9s is a CLI to view and manage your Kubernetes clusters.
publisher: Fernand Galiana (derailed)
contact: [email protected]
license: unset
description: |
K9s is a CLI to view and manage your Kubernetes clusters.
By leveraging a terminal UI, you can easily traverse Kubernetes resources
and view the state of you clusters in a single powerful session.
commands:
- k9s
snap-id: IIsGjhjg5ghn6VAZFbferlrrh4zy2kO9
tracking: stable
refresh-date: today at 22:20 CEST
channels:
stable: 0.7.7 2019-06-14 (126) 9MB -
candidate: ↑
beta: ↑
edge: 0.5.1 2019-04-19 (99) 9MB devmode
installed: 0.7.7 (126) 9MB -
22:22:07 ⌂69% θ64° [rolf:~] $ whereis k9s
k9s: /snap/bin/k9s
22:22:20 ⌂64% θ64° [rolf:~] $ k9s
____ __.________
| |/ _/ __ \______
| < \____ / ___/
| | \ / /\___ \
|____|__ \ /____//____ >
\/ \/
Boom!! Refine Config.
22:22:23 ⌂61% θ67° [rolf:~] $
22:25:43 θ64° [rolf:~] $ k9s version
____ __.________
| |/ _/ __ \______
| < \____ / ___/
| | \ / /\___ \
|____|__ \ /____//____ >
\/ \/
Version: 0.7.7
Commit: 2eb817fda8c62c772cfdd0424cbe54706c356f26
Date: 2019-06-14T01:50:05Z
To Reproduce
Had 0.7.5 installed. Installed 0.7.7 with snap and got this error. Tried deleting .k9s folder but no difference.
Expected behavior
k9s to make awesome
Versions (please complete the following information):
@roflmao Thank you for reporting this. Could you send me the K9s logs as well, thinking something with the snap release is still not quiet right ;(
the log is empty (i deleted all the old logs after upgrading)
$ k9s info
____ __.________
| |/ _/ __ \______
| < \____ / ___/
| | \ / /\___ \
|____|__ \ /____//____ >
\/ \/
Configuration: /home/rolf/.k9s/config.yml
Logs: /tmp/k9s-rolf.log
Screen Dumps: /tmp/k9s-screens-rolf
$ cat /tmp/k9s-rolf.log
$
stracing the k9s run shows that it looks like it cant find the kube config due to path issues with snap:
<snipping 1500 lines>
newfstatat(AT_FDCWD, "/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}, 0) = 0
openat(AT_FDCWD, "/tmp/k9s-root.log", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0644) = 3
epoll_ctl(4, EPOLL_CTL_ADD, 3, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=3045617496, u64=139696856919896}}) = -1 EPERM (Operation not permitted)
epoll_ctl(4, EPOLL_CTL_DEL, 3, 0xc0005e1c74) = -1 EPERM (Operation not permitted)
openat(AT_FDCWD, "/etc//localtime", O_RDONLY) = 5
read(5, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0\0\0\0"..., 4096) = 2251
read(5, "", 4096) = 0
close(5) = 0
write(3, "\33[90m10:18AM\33[0m \33[32mINF\33[0m \360\237"..., 54) = 54
openat(AT_FDCWD, "/root/.k9s/config.yml", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(3, "\33[90m10:18AM\33[0m \33[31mWRN\33[0m Un"..., 91) = 91
newfstatat(AT_FDCWD, "/root/snap/k9s/126/.kube/config", 0xc0000a1558, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/snap/k9s/126/.kube/.kubeconfig", 0xc0000a1628, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/root/snap/k9s/126/.kube/config", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(3, "\33[90m10:18AM\33[0m \33[1m\33[31mPNC\33[0"..., 132) = 132
write(1, "\33[H\33[2J", 7
) = 7
write(3, "\33[90m10:18AM\33[0m \33[1m\33[31mERR\33[0"..., 58) = 58
write(3, "\33[90m10:18AM\33[0m \33[1m\33[31mERR\33[0"..., 1792) = 1792
write(1, "\33[31m ____ __.________ \33["..., 35 ____ __.________
) = 35
write(1, "\33[31m| |/ _/ __ \\______\33["..., 35| |/ _/ __ \______
) = 35
write(1, "\33[31m| < \\____ / ___/\33["..., 35| < \____ / ___/
) = 35
write(1, "\33[31m| | \\ / /\\___ \\ \33["..., 35| | \ / /\___ \
) = 35
write(1, "\33[31m|____|__ \\ /____//____ >\33["..., 35|____|__ \ /____//____ >
) = 35
write(1, "\33[31m \\/ \\/ \33["..., 35 \/ \/
) = 35
write(1, "\n", 1
) = 1
write(1, "\33[31mBoom!! \33[0m", 16Boom!! ) = 16
write(1, "\33[37mRefine Config.\33[0m\n", 24Refine Config.
) = 24
exit_group(0) = ?
+++ exited with 0 +++
Link to the whole strace: http://paste.ubuntu.com/p/bvd5dC39mt/
@roflmao Thank you for sending this! Could you do me a favor and try the following provided you're using a std kuconfig setup. Thank you!!
export KUBECONFIG=$HOME/.kube/config
k9s -l debug
Great success!
There is no log in /tmp/k9s-rolf.log as stated by k9s info though.
-l debug doesnt make any difference
Found logs in /tmp/snap.k9s/tmp !
Before export KUBECONFIG:
8:47PM INF 🐶 K9s starting up...
8:47PM WRN Unable to locate K9s config. Generating new configuration...
8:47PM PNC Refine Config error="The specified context ` does not exists in kubeconfig"
8:47PM ERR Boom! Refine Config
8:47PM ERR goroutine 1 [running]:
runtime/debug.Stack(0x28e8500, 0x17f9603, 0x0)
/usr/local/Cellar/go/1.12.5/libexec/src/runtime/debug/stack.go:24 +0x9d
github.com/derailed/k9s/cmd.run.func1()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:67 +0x185
panic(0x15988a0, 0xc00026cfe0)
/usr/local/Cellar/go/1.12.5/libexec/src/runtime/panic.go:522 +0x1b5
github.com/rs/zerolog.(*Logger).Panic.func1(0x17fff57, 0xd)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/rs/[email protected]/log.go:319 +0x4f
github.com/rs/zerolog.(*Event).msg(0xc0000805a0, 0x17fff57, 0xd)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/rs/[email protected]/event.go:141 +0x1c1
github.com/rs/zerolog.(*Event).Msg(...)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/rs/[email protected]/event.go:105
github.com/derailed/k9s/cmd.loadConfiguration(0x0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:95 +0x4c3
github.com/derailed/k9s/cmd.run(0x28d8fc0, 0x29068b8, 0x0, 0x0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:75 +0x87
github.com/spf13/cobra.(*Command).execute(0x28d8fc0, 0xc00003a190, 0x0, 0x0, 0x28d8fc0, 0xc00003a190)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0x28d8fc0, 0x0, 0x0, 0x0)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ec
github.com/spf13/cobra.(*Command).Execute(...)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:800
github.com/derailed/k9s/cmd.Execute()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:57 +0x2e
main.main()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/main.go:26 +0x1a7
After:
8:48PM INF 🐶 K9s starting up...
8:48PM WRN Unable to locate K9s config. Generating new configuration...
8:48PM INF ✅ Kubernetes connectivity
8:48PM WRN No benchmark config file found, using defaults. error="open /home/rolf/.k9s/bench-gm.yml: no such file or directory"
8:48PM WRN No skin file found. Loading defaults. error="open /home/rolf/.k9s/skin.yml: no such file or directory"
So looks like all .k9s related stuff also is broken (its generating config every time)
@roflmao Thank you so much for reporting back! Crap!! Looks like, back to the old drawing board. The snap folks told me I should not have to do anything else ;( If you can limp along for now with this fix, I'll try to spend some time on this and figure out an alternative. If there are any Snapcraft savvy folks on the line, I sure could use some help...
Also this trying to edit config:
1:43PM ERR Unable to find kubeclt command in path exec: "kubectl": executable file not found in $PATH
To start k9s with snap on Ubuntu 18.04 I had to manually create ~/.k9s and run it with k9s --kubeconfig ~/.kube/config
I have the same issue with snap:
Unable to find kubeclt command in path exec: "kubectl": executable file not found in $PATH
@roflmao @lukaszo @joskfg Thank you for reporting this! The snap release is indeed a mess as you've all pointed out. The main issue is that $HOME/.k9s is getting sandboxed as $HOME is getting remapped as a snap. I have an issue pending with the Snap folks to see if we can get granted classic confinement just like kubectl so that we can use $HOME as expected by the go standard lib. This process has unfortunately been very slow ;(
@roflmao @lukaszo @joskfg - the interaction with the snap folks is taking forever. Think you should give LinuxBrew install instead. Can you give 0.7.13 a rinse? Thank so very much for all your reports!
Have the same issue on Ubuntu 18.04, also I tried to follow https://github.com/derailed/k9s/issues/240#issuecomment-505823987 suggestion, I still got:
| |/ _/ __ \______
| < \____ / ___/
| | \ / /\___ \
|____|__ \ /____//____ >
\/ \/
Boom!! Unable to locate K8s cluster configuration
If I take a look at logs there seam to be permission/ownership issue:
3:08PM INF 🐶 K9s starting up...
3:08PM WRN Unable to locate K9s config. Generating new configuration...
3:08PM PNC Unable to locate K8s cluster configuration error="Error loading config file \"/home/anita/.kube/config\": open /home/anita/.kube/config: permission denied"
3:08PM ERR Boom! Unable to locate K8s cluster configuration
3:08PM ERR goroutine 1 [running]:
runtime/debug.Stack(0x290f3c0, 0x1805703, 0x0)
/usr/local/Cellar/go/1.12.6/libexec/src/runtime/debug/stack.go:24 +0x9d
github.com/derailed/k9s/cmd.run.func1()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:67 +0x185
panic(0x15a3220, 0xc0002bfbd0)
/usr/local/Cellar/go/1.12.6/libexec/src/runtime/panic.go:522 +0x1b5
github.com/rs/zerolog.(*Logger).Panic.func1(0x1831ace, 0x2a)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/rs/[email protected]/log.go:319 +0x4f
github.com/rs/zerolog.(*Event).msg(0xc0000c85a0, 0x1831ace, 0x2a)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/rs/[email protected]/event.go:141 +0x1c1
github.com/rs/zerolog.(*Event).Msg(...)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/rs/[email protected]/event.go:105
github.com/derailed/k9s/cmd.loadConfiguration(0x0)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:99 +0x4d2
github.com/derailed/k9s/cmd.run(0x28fffa0, 0xc0000d0780, 0x0, 0x2)
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:75 +0x87
github.com/spf13/cobra.(*Command).execute(0x28fffa0, 0xc0000b2070, 0x2, 0x2, 0x28fffa0, 0xc0000b2070)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0x28fffa0, 0x0, 0x0, 0x0)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ec
github.com/spf13/cobra.(*Command).Execute(...)
/Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:800
github.com/derailed/k9s/cmd.Execute()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:57 +0x2e
main.main()
/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/main.go:26 +0x1a7
Anyhow /home/anita/.kube/config is owned by same user as k9s and permissions seam legit... maybe someone experienced same?
@anitabee I've been trying with no success to ask the Snap folks to allow K9s access to the home user directory. This has sadly been a dud so far ;(. Could you given LinuxBrew a shot and see if that allows you to further explore K9s. The other option would to install from the release page. Sorry for the inconvenience of yet another installer to deal with but there seems to be no viable options of using K9s as a snap at the moment.
Ah, too bad @derailed, thanks for explanation! Will try installation from source.
Update: edge installation worked snap install k9s --edge --devmode as mentioned https://github.com/derailed/k9s/issues/166#issuecomment-485059530
Most helpful comment
To start k9s with snap on Ubuntu 18.04 I had to manually create
~/.k9sand run it withk9s --kubeconfig ~/.kube/config