DEV Community

Prithiviraj R
Prithiviraj R

Posted on

Setting Up Kubernetes Dashboard in AWS EKS: A Step-by-Step Guide

Kubernetes Dashboard is a powerful web-based UI to monitor and manage your cluster resources effortlessly. If you're running your workloads on AWS EKS, adding the dashboard will elevate your management experience. Let’s dive into the steps! 🌟

Image description

Prerequisites to Get Started 🛠️
Before diving in, ensure you have the following:

  1. AWS CLI installed and configured with access to your AWS account.
  2. kubectl installed and connected to your EKS cluster.
  3. Admin or elevated permissions to manage the cluster. Step 1: Set Up Your EKS Cluster Before we deploy the game, let's set up an EKS cluster using eksctl, which simplifies the process of creating and managing EKS clusters.
eksctl create cluster --name eks-workshop --region eu-west-1 --nodegroup-name
eks-workshop-default-node --node-type m5.large --nodes 3 --nodes-min 1 --nodes-
max 4 --managed
Enter fullscreen mode Exit fullscreen mode

Image description

Image description

Step 2: Configure kubectl to Use Your EKS Cluster

Once your EKS cluster is up and running, configure your kubectl to interact with the new cluster.

# Update kubeconfig for kubectl
aws eks --region eu-west-1 update-kubeconfig --name racing eks-workshop
Enter fullscreen mode Exit fullscreen mode

Step 3: Create the Kubernetes Deployment for the Game
application
We'll now deploy the sample racing game by creating a Deployment. This defines the desired
state of your application, including the number of replicas and container image to use.

Image description

The Kubernetes Dashboard is a great way to monitor your Kubernetes resources visually. To
deploy and access the Kubernetes Dashboard, follow these steps:
1. Install the Kubernetes Dashboard:

kubectl apply -f
https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.0/aio/deploy/recommen
ded.yaml
Enter fullscreen mode Exit fullscreen mode
  1. Create an admin user for accessing the Dashboard with appropriate permissions. Create a file named admin-user.yaml :
apiVersion: v1kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
Enter fullscreen mode Exit fullscreen mode

Apply this configuration:

kubectl apply -f admin-user.yaml
Enter fullscreen mode Exit fullscreen mode

3. Get the token to log into the Dashboard:

kubectl -n kubernetes-dashboard create token admin-user
Enter fullscreen mode Exit fullscreen mode

4. Access the Dashboard:
To open the Dashboard, use kubectl proxy :

Now, navigate to http://localhost:8001/ui in your web browser and log in using the token you
retrieved earlier.
From the Dashboard, you can view your deployed Pods, Services, PVCs, and more, helping you
monitor and manage the game deployment efficiently.

Image description

Image description

Image description

Image description

Conclusion
The Kubernetes Dashboard makes managing your AWS EKS cluster much simpler and
visually intuitive. It’s an essential tool for admins and DevOps teams to monitor, troubleshoot, and
optimize cluster resources.
Take your Kubernetes experience to the next level!

Happy Learning
Prithiviraj Rengarajan
DevOps Engineer

Top comments (0)