Skip to content

Pod shell connection error#

An error can occur while connecting to a pod shell. The issue is caused by a missing client-go credential plugin for kubectl.

See the error message example below:

"Unhandled Error" err=<
couldn't get current server API group list:...
getting credentials: exec: executable kubectl not found

It looks like you are trying to use a client-go credential plugin that is not installed.

To learn more about this feature, consult the documentation available at:
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins

Workaround

  1. Open a shell to verify that kubectl works outside Lens K8S IDE:

      which kubectl
    
      which kubectl
    
      where.exe kubectl
    

    An example of response:

      /Users/<user-name>/Library/Application Support/Lens/binaries/kubectl/1.33/kubectl
    
      /Users/<user-name>/Library/Application Support/Lens/binaries/kubectl/1.33/kubectl
    
      C:\Users\<user-name>\AppData\Roaming\Lens\binaries\kubectl\1.32\kubectl.exe
    
  2. If kubectl is listed in the utility response, install an authentication plugin.

    Tip

    Ensure that the credential plugin matches your cluster provider.

  3. Log in to the cluster provider and proceed to Lens K8S IDE.

  4. From a cluster view, open Terminal to verify that the application is connected to the necessary kubectl binary. Use the same command from the step 1.
  5. If the kubectl binary is not listed, toggle off Kubectl Binary Download and specify path to the kubectl binary in Preferences > Kubernetes.

See also

Kubernetes official documentation. Authenticating: client-go credential plugins