Lens is a really cool front end dashboard for Kubernetes clusters. One issue I ran into from connecting to the cluster was that I typically use different AWS Profiles for different clusters.
Typically I’ll do something like:
export AWS_PROFILE=eksdude
To set my user. To put this in Lens so that it can connect, we just add this to the environment variable in the ./kube/config
file:
users:
- name: eksdude@dec14.us-west-2.eksctl.io
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
args:
- token
- -i
- dec14
command: aws-iam-authenticator
env:
- name: AWS_STS_REGIONAL_ENDPOINTS
value: regional
- name: AWS_DEFAULT_REGION
value: us-west-2
- name: AWS_PROFILE
value: eksdude
Then we can simply add this to Lens
![](https://benincosa.com/wp-content/uploads/2020/12/Screen-Shot-2020-12-14-at-1.21.13-PM.png)
I’ve also found that I can make Lens work with EKS clusters that sit on a private network. I just use sshuttle -r <bastion host> 0/0
and it connects perfectly!