Step-by-Step Guide: Connecting to Amazon EKS and Monitoring with Lens


Introduction
This guide is your roadmap to seamlessly connect your developer workstation to an Amazon Elastic Kubernetes Service (EKS) cluster and harness the power of Lens for effective monitoring and management. In this walkthrough, we'll walk you through the essential steps required to establish this connection, ensuring you have the tools and configurations in place to streamline your Kubernetes operations.
Whether you're an experienced Kubernetes practitioner or just beginning your journey with EKS, this guide will equip you with the knowledge and resources to make the process straightforward. Let's embark on this journey to unlock the potential of EKS and Lens for your Kubernetes development and administration needs.
Steps to Follow
Step 1: Configure the AWS Environment
You need to obtain the "Access Key" and "Secret Access Key" to interact with AWS services programmatically or through the AWS CLI.
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
Step 2: Install kubectl
Kubectl is a command-line tool that allows you to interact with Kubernetes clusters. You can download and install it by following the instructions in the official Kubernetes documentation:
https://kubernetes.io/docs/tasks/tools/install-kubectl/
Step 3: Install Lens
Lens is a Kubernetes cluster management tool that allows you to visualize and manage Kubernetes clusters centrally. You can download and install Lens from the official website:
Step 4: Configure kubectl for EKS
With the AWS CLI properly installed and configured, to install kubectl, you need to execute the following command:
aws eks --region eu-central-1 update-kubeconfig --name cluster-stack
- Verify the Connection:
To ensure that kubectl is configured correctly and can connect to the EKS cluster, you should run the following command:
kubectl config get-contexts
You should see a list of Kubernetes contexts, including the context for your EKS cluster that was created earlier.
Step 6: Open Lens and Add the Cluster
Open the Lens application on your local machine.
- Click "Add Cluster" on the main screen.
- Select "Kubeconfig" as the authentication method.
Click "Browse" and select the kubectl configuration file generated in Step 4 (usually located at ~/.kube/config).
Click "Next" and provide a name for the cluster.
Click "Connect" to add the cluster to Lens.
You should now be able to view and manage your EKS cluster in Lens remotely from your local machine.
Conclusion
To put it simply, Lens is a fantastic choice for connecting to your Amazon Elastic Kubernetes Service (EKS) clusters. Why? Well, it's like having a super user-friendly control center for all things Kubernetes. It makes monitoring and managing your clusters easier.
With Lens, you get a clear and easy-to-use dashboard cluster's health and performance. So, if you want to make your Kubernetes life easier and more efficient, Lens is the way to go!
Subscribe to my newsletter
Read articles from Amador Criado directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Amador Criado
Amador Criado
Cloud Architect/Engineer with leadership and communication skills. Ownership of the entire lifecycle of a project (SDLC), and motivated to continue growing in Cloud and automation. Passionate about new technologies, responsible and enthusiastic collaborator dedicated to streamline processes and eciently solve project requirements.