Add Cluster
{{ errorDetails }}
Clusters associated with Lens
Add clusters by clicking the Add Cluster button. You'll need to obtain a working kubeconfig for the cluster you want to add.
Each cluster context is added as a separate item in the left-side cluster menu to allow you to operate easily on multiple clusters and/or contexts.
For more information on kubeconfig see Kubernetes docs
NOTE: Any manually added cluster is not merged into your kubeconfig file.
To see your currently enabled config with kubectl, use kubectl config view --minify --raw command in your terminal.
When connecting to a cluster, make sure you have a valid and working kubeconfig for the cluster. Following lists known "gotchas" in some authentication types used in kubeconfig with Lens app.
OIDC (OpenID Connect)
When connecting Lens to OIDC enabled cluster, there's few things you as a user need to take into account.
Dedicated refresh token
As Lens app utilized kubeconfig is "disconnected" from your main kubeconfig Lens needs to have it's own refresh token it utilizes.
If you share the refresh token with e.g. kubectl who ever uses the token first will invalidate it for the next user.
One way to achieve this is with kubelogin tool by removing the tokens (both id_token and refresh_token) from the config and issuing kubelogin command. That'll take you through the login process and will result you having "dedicated" refresh token.
Exec auth plugins
When using exec auth plugins make sure the paths that are used to call any binaries are full paths as Lens app might not be able to call binaries with relative paths. Make also sure that you pass all needed information either as arguments or env variables in the config, Lens app might not have all login shell env variables set automatically.