# Adding AKS clusters to lens desktop

**URL:** <https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226>\
**Category:** Lens Support & Troubleshooting\
**Tags:** lens-desktop, cluster\
**Created:** [March 7, 2023, 11:00pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226 "2023-03-07T23:00:35Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![elbilo](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/e/a88e4f/32.png) [@elbilo](https://forums.k8slens.dev/u/elbilo)\
**Post date:** [March 7, 2023, 11:00pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/1 "2023-03-07T23:00:35Z")

</div>

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](http://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.

---

<div class="post-metadata">

**Author:** ![jehrismann](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/jehrismann/32/398_2.png) [@jehrismann](https://forums.k8slens.dev/u/jehrismann)\
**Post date:** [March 8, 2023, 2:42pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/2 "2023-03-08T14:42:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![elbilo](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/e/a88e4f/32.png) [@elbilo](https://forums.k8slens.dev/u/elbilo)\
**Post date:** [March 8, 2023, 5:31pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/3 "2023-03-08T17:31:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jehrismann](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/jehrismann/32/398_2.png) [@jehrismann](https://forums.k8slens.dev/u/jehrismann)\
**Post date:** [March 8, 2023, 7:40pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/4 "2023-03-08T19:40:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![elbilo](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/e/a88e4f/32.png) [@elbilo](https://forums.k8slens.dev/u/elbilo)\
**Post date:** [March 10, 2023, 9:13pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/5 "2023-03-10T21:13:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![elbilo](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/e/a88e4f/32.png) [@elbilo](https://forums.k8slens.dev/u/elbilo)\
**Post date:** [March 10, 2023, 9:25pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/6 "2023-03-10T21:25:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jehrismann](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/jehrismann/32/398_2.png) [@jehrismann](https://forums.k8slens.dev/u/jehrismann)\
**Post date:** [March 13, 2023, 2:50pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/7 "2023-03-13T14:50:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![goranhalvarsson](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/goranhalvarsson/32/405_2.png) [@goranhalvarsson](https://forums.k8slens.dev/u/goranhalvarsson)\
**Post date:** [June 9, 2023, 1:42pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/8 "2023-06-09T13:42:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dheeraj.vanteru](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/d/e480ec/32.png) [@dheeraj.vanteru](https://forums.k8slens.dev/u/dheeraj.vanteru)\
**Post date:** [June 19, 2023, 8:08am UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/9 "2023-06-19T08:08:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jehrismann](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/jehrismann/32/398_2.png) [@jehrismann](https://forums.k8slens.dev/u/jehrismann)\
**Post date:** [June 21, 2023, 4:41pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/10 "2023-06-21T16:41:42Z")

</div>

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.

 ![Screen Shot 2023-06-21 at 12.39.25 PM](https://forums.k8slens.dev/original/1X/e07fbeba6cf3bd29f6dcb4507d1101da0e2174e2.png)  
)

---

<div class="post-metadata">

**Author:** ![dev-chirag](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/d/58956e/32.png) [@dev-chirag](https://forums.k8slens.dev/u/dev-chirag)\
**Post date:** [June 27, 2023, 2:52pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/11 "2023-06-27T14:52:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dev-chirag](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/d/58956e/32.png) [@dev-chirag](https://forums.k8slens.dev/u/dev-chirag)\
**Post date:** [June 27, 2023, 3:04pm UTC](https://forums.k8slens.dev/t/adding-aks-clusters-to-lens-desktop/226/12 "2023-06-27T15:04:13Z")

</div>

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:

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

```

and the profile name should match the aws credentials file:

```auto
[default]
aws_access_key_id = 
aws_secret_access_key = 

[xyz]
aws_access_key_id=
aws_secret_access_key=
aws_session_token=

```
