Add a local cluster#
Lens Desktop uses kubeconfig files to connect to Kubernetes clusters from your local filesystem. By default, Lens Desktop 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 Desktop interface.
- In Navigator, click Kubernetes Clusters> Local Kubeconfigs.
- Click Add Kubeconfigs > Add kubeconfig by pasting.
- In the following modal, paste the contents of your kubeconfig file into the input field.
- Click Add Clusters.
Tip
Lens Desktop saves the configurations and creates a kubeconfig file in the kubeconfigs
directory of the application: ~/.lens/kubeconfigs
.
- Open Preferences > Kubernetes > Manage Kubeconfigs.
- Click Add from filesystem.
- Select a kubeconfig file from your local filesystem.
Lens Desktop 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 theuser
definition fromclient.authentication.k8s.io/v1alpha1
toclient.authentication.k8s.io/v1beta1
- Review the rest of the kubeconfig file and adjust the configurations if necessary