question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kubernetes command failed

See original GitHub issue

I use kubectl on my Linux Mint box via snap. I run microk8s (still via snap) locally as well as using remote k8s clusters (Azure, Docker for Mac remotely, etc). I run helm also via snap. So, my snap list looks like (snippet):

Name                   Version                     Rev   Tracking       Publisher              Notes
code                   a5d1cc28                    34    latest/stable  vscode✓                classic
core                   16-2.45                     9289  latest/stable  canonical✓             core
docker                 19.03.11                    471   latest/stable  canonical✓             -
helm                   3.2.3                       244   latest/stable  snapcrafters           classic
kubectl                1.18.3                      1534  latest/stable  canonical✓             classic
microk8s               v1.18.3                     1443  latest/stable  canonical✓             classic

Note that I have a ~/.kube/config with several clusters, all work fine from the shell.

I decided to give vscode-kubernetes-tools a spin. After installation when you click on the extension logo in the Activity Bar, the list of clusters, helm repos, and clouds stay empty (I saw the little progress bar running for each for a few seconds); a toaster popped up saying only: Kubectl command failed: without any explanation whatsover.

I looked at the Output view in the Log (Extension Host) and nothing either.

Not sure where to look for information and reasons why the extension believes it cannot run kubectl

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

7reactions
gildascommented, Jun 19, 2020

@lstocchi I installed the extension from the download link you gave me.

And I still get the Kubectl command failed: even after setting the flag:

    "vs-kubernetes": {
        "vs-kubernetes.enable-snap-flag": true
    }

I restarted vscode entirely after setting it, just to be sure.

3reactions
lstocchicommented, Jun 18, 2020

@gildas I was able to replicate it and i think i have a fix (#771) . Would you please try it and see if it works for you?

You can install the extension by using a vsix file. I created it (download link: https://github.com/lstocchi/vscode-kubernetes-tools/raw/master/vscode-kubernetes-tools-1.2.1.vsix ) or you can build it by yourself (you can use this branch https://github.com/lstocchi/vscode-kubernetes-tools/tree/i770 ).

Once installed you should keep seeing the error as before Kubectl command failed:. Now if you go in the settings page and set “vs-kubernetes.enable-snap-flag” to true the extension should start working normally (CMD/CTRL + SHIFT + P -> search for Open Setting -> click on Preferences: Open Settings (JSON) -> add "vs-kubernetes.enable-snap-flag": true and save).

image

If you can confirm it works it would be really helpful for us. Thank you!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kubernetes command failed · Issue #770 · vscode ... - GitHub
I use kubectl on my Linux Mint box via snap. I run microk8s (still via snap) locally as well as using remote k8s...
Read more >
Determine the Reason for Pod Failure - Kubernetes
After the container writes the "Sleep expired" message, it terminates. Display information about the Pod: kubectl get pod termination-demo.
Read more >
Is Your Kubernetes Pod Failing to Start? Here's a Command to ...
Pending means that your container has not been created, and is waiting for a specific condition to be satisfied before scheduling can occur....
Read more >
Kubectl exec command fails due to 'No such file or directory'
I am guessing this is causing the commands to fails when run through kubectl exec. Any ideas to overcome this are welcome; can...
Read more >
Troubleshooting 'terminated with exit code 1' error - ContainIQ
Use the kubectl logs command to retrieve the logs for the first container in your pod. When the pod's stuck in a restart...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found