Skip to content

Add a local cluster#

Lens K8S IDE uses kubeconfig files to connect to Kubernetes clusters from your local filesystem. By default, Lens K8S IDE automatically detects kubeconfig files located in the ~/.kube/ directory.

To view clusters specified in kubeconfig files, click Kubernetes Clusters > Local Kubeconfigs in Navigator.

Add kubeconfig files#

In addition to the default automatic sync, you can add more clusters through various methods:

You can add Kubernetes clusters manually through the Lens K8S IDE interface.

  1. In Navigator, click Kubernetes Clusters> Local Kubeconfigs.
  2. Click Add Kubeconfigs > Add kubeconfig by pasting.
  3. In the following modal, paste the contents of your kubeconfig file into the input field.
  4. Click Add Clusters.

Tip

Lens K8S IDE saves the configurations and creates a kubeconfig file in the kubeconfigs directory of the application: ~/.lens/kubeconfigs.

  1. Open Preferences > Kubernetes > Manage Kubeconfigs.
  2. Click Add from filesystem.
  3. Select a kubeconfig file from your local filesystem.

Lens K8S IDE displays clusters specified in the kubeconfig file in Kubernetes Clusters > Local Kubeconfigs

Manage Kubeconfigs#

Right-click on Local Kubeconfigs and select Manage Kubeconfigs to open Preferences > Kubernetes. In this menu you can configure kubectl, specify kubeconfig files, and manage Helm chart repositories.

Troubleshooting#

Problems with adding or connecting to local clusters#

When having problems with connecting to a local cluster:

  • Check the cluster configurations in Terminal:

    kubectl config view --minify --raw
    
  • Update your Kubernetes tools (kubectl, aws cli, eksctl, gcloud)

  • Generate new kubeconfig file for the cluster

Issues with old Kubernetes versions#

For Kubernetes clusters older than version 1.24:

  • Update the apiVersion field of the user definition from client.authentication.k8s.io/v1alpha1 to client.authentication.k8s.io/v1beta1
  • Review the rest of the kubeconfig file and adjust the configurations if necessary