kube-commander
kube-commander copied to clipboard
Bug: snapped kube-commander cannot find kubectl
Hi
Describe the bug
snap version of kube-commander cannot retrieve logs from a pod
To Reproduce
- select a running pod
- type 'L'
- kube-commander shows an error:
kubectl: command not found
Expected behavior
kube-commander shows the logs of the pod
Note that logging works as expected when running kube-commander from the released tarball downloaded from github.
Screenshots or logs Here's a sligthty edited logs output showing the error:
Executing command: /bin/bash -c KUBECONFIG=/home/domi/.kube/config:/home/domi/.kube/redacted-ovh.config:/home/domi/.kube/redacted-azure-config.yml kubectl --context redacted-azure-dev --namespace prod logs -c redacted-chatserver --tail 1000 --follow redactedchatserver-6c45ffbc9d-dh6wd /bin/bash: kubectl: command not found error executing command: exit status 127
Desktop (please complete the following information):
- OS: Debian/unstable
- Terminal emulator: konsole
Additional context
- installed from snap
- kubectl is available in /usr/bin/kubectl and installed with snap
All the best
Thank you for the report
Seems to me that snap's way to launch applications has something to do with that. Looking into it
I had to switch kube-commander to classic snap grade to make it work properly. This means that it will have to be reviewed manually by Snap Store team and it will require --classic
flag during installation.
I'm keeping this issue to keep track of the review process
I filed a review request: https://forum.snapcraft.io/t/classic-confinement-for-kube-commander/18456
For what it's worth, some alternatives to using --classic
are:
- include
kubectl
in your snap - use kubernetes API to get logs (and perform the other operations where
kubectl
is required)