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

Bug: snapped kube-commander cannot find kubectl

Open dod38fr opened this issue 4 years ago • 4 comments

Hi

Describe the bug

snap version of kube-commander cannot retrieve logs from a pod

To Reproduce

  1. select a running pod
  2. type 'L'
  3. 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

dod38fr avatar Jun 24 '20 13:06 dod38fr

Thank you for the report

Seems to me that snap's way to launch applications has something to do with that. Looking into it

AnatolyRugalev avatar Jun 24 '20 17:06 AnatolyRugalev

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

AnatolyRugalev avatar Jun 24 '20 18:06 AnatolyRugalev

I filed a review request: https://forum.snapcraft.io/t/classic-confinement-for-kube-commander/18456

AnatolyRugalev avatar Jun 24 '20 19:06 AnatolyRugalev

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)

dod38fr avatar Jun 25 '20 06:06 dod38fr