how to change kubectl version in lens?

10/12/2021

First I installed lens on my mac, when I try to shell one of the pods, there's message said that I don't have any kubectl installed, so I install kubectl and it works properly.

Now I try to change configmaps but I get an error

kubectl/1.18.20/kubectl not found

When I check the kubectl folder there's 2 kubectl version 1.18.20 and 1.21.

1.21 is the one that I installed before.

How can I move kubectl version that has define in lens (1.18.20) and change it to 1.21 ?

Note:

  • Lens: 5.2.0-latest.20210908.1
  • Electron: 12.0.17
  • Chrome: 89.0.4389.128
  • Node: 14.16.0
  • © 2021 Mirantis, Inc.

Thanks in advance, sorry for bad English

-- lauwis premium
kubectl
kubernetes

1 Answer

10/12/2021

You can set kubectl path at File -> Preference -> Kubernetes -> PATH TO KUBECTL BINARY. Or you can also check "Download kubectl binaries matching the Kubernetes cluster version", this way Lens will use the same version as your target cluster.

By the way, you should use latest v5.2.5.

-- gohm'c
Source: StackOverflow