Adding AKS clusters to lens desktop

I’m having problems adding our AKS cluster to the LENS desktop. I went to the LENS documentation but I find that it glosses over any detailed steps. Is there someplace that does a step by step walkthrough on configuring the desktop to connect to the AKS resources?

This is the error I’m getting:
"E0307 22:54:59.240070 6796 proxy_server.go:147] Error while proxying request: dial tcp: lookup stage01-wcu-aks01-dns-7dfc6c66.60496505-4cc9-4ba9-9537-639c1f936d83.privatelink.westcentralus.azmk8s.io: no such host

Failed to get /version for clusterId=6f8d4f06cc1b5bf2f3314437432d8fcb: Internal Server Error"

I tried adding the aks API uri in the proxy setting but no go, I also tried putting the DNS IP there but also a non-starter.

I’m kind of new to this AKS stuff, sdo any help to get me going would be appreciated.

Are you able to connect to the cluster using kubectl (on the same system you are running Lens)? You could try launching Lens from the same shell that kubectl works in. In some cases Lens does not get the same shell environment when launched from the GUI. What platform are you running Lens on?

We’re running LENS under windows 10. It’s a VM running in the same azure subscription and is peered with the K8 cluster. The same instance of LENS while not able to access this environment’s cluster does access other K8cluster in our other environments/subscriptions.

So you are able to connect to the cluster in question using kubectl?

no, even following the “step by step” for using Kubectl under the Azure CLI, I could not get a list of anything in the cluster just the same errors listed above.

One thing that I don’t understand is the syntax and source of the data (or generate it) I need enter in the add cluster panel. I copied over those settings for a different set of cluster in a different azure subscription from my local machine and I can connect to those other cluster from the VM, I just can’t seem to add these new clusters.

It could be an AKS issue with connecting to that cluster. Lens relies on the same kube config that kubectl uses. If you can’t connect using kubectl then Lens typically won’t work either. Unfortunately I don’t have any experience with AKS, maybe someone else here does.

We are using Lens and AKS, and we have no issues
We are using the “kube config”

1 Like

Hi There, I am having a similar issues connecting to EKS clusters, I am able to connect with kubectl command and no issues. I think Lens desktop on windows 10 isn’t working as expected. But my colleagues can connect using Lens on their mac’s.

Failed to get /version for clusterId=XXXXXXXXXXXX: Unauthorized.

  1. Checked AWS and it is in path.
  2. Tried to connect to the cluster using kubectl

You could try starting Lens from the terminal where you know kubectl works. Rerun the aws eks update-kubeconfig, and check that Lens is using the same kube config as kubectl? (In the Lens Catalog Cluster list each local cluster has a file= ... label.


)

When you say launch from the same terminal, do you mean launch the shortcut? I am on windows and facing the same issue. I can connect to AWS using kubectl and k9s both, but not from lens.

Ok, I figured it out. You need to add the following to tell your aws command to use the correct AWS access and secret key:

 - --region
      - eu-west-1
      - eks
      - get-token
      - --cluster-name
      - named
      - --output
      - json
      - --profile
      - xyz

and the profile name should match the aws credentials file:

[default]
aws_access_key_id = 
aws_secret_access_key = 

[xyz]
aws_access_key_id=
aws_secret_access_key=
aws_session_token=
1 Like