Error: kubectl not found
See original GitHub issueSystem Information:
- MacOS: 10.15.7
- VSCode: 1.60.0
- Kubernetes Extension: v1.3.3
Recently I started having an issue where the extension cannot find kubectl
on VSCode launch. I get an error saying
Kubectl command failed: kubectl not found
In my settings, I have tried setting both vscode-kubernetes.kubectl-path
as well as vscode-kubernetes.kubectl-path.mac
to a specific path and it is giving the same error. E.g.
"vscode-kubernetes.kubectl-path": "/usr/local/bin/kubectl"
And /usr/local/bin/kubectl
is the same path I get when I run which kubectl
I am using settings sync but this particular setting is ignored so nothing should be stepping on top of it.
I have also not been able to find any specific logs for this extension loading but not sure if I am looking in the correct place or not.
In addition, I have installed kubectl to the local default directory used by the extension at ~/.vs-kubernetes/tools
as well but that has not fixed the issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (1 by maintainers)
Top GitHub Comments
We are having the same issue when using microk8s as well.
For example, in theory it would be enough to point it to the kubectl path:
But this fails since it expects the binary itself to be named
kubectl
and does not accept anything else which defeats the purpose of the path variable.kubectl
installed via Homebrew at/opt/homebrew/bin/kubectl
and is on system PATH.Found similar issue. I’ve got this error notification when opening kubeconfig file (i.e.
/Users/foo/.kube/config
) in my vscode.In my case, I don’t have
vs-kubernetes.kubectl-path
orvscode-kubernetes.kubectl-path
settings whatsoever. Only related extension setting isI solved this by deleting
~/.vs-kubernetes
folder, uninstall the extension and then re-install it. Now the error notification doesn’t popup anymore.