Lens and EKS

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

Lens is a great tool!