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! 🌟
Prerequisites to Get Started 🛠️
Before diving in, ensure you have the following:
- AWS CLI installed and configured with access to your AWS account.
- kubectl installed and connected to your EKS cluster.
- 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
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
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.
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
- 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
Apply this configuration:
kubectl apply -f admin-user.yaml
3. Get the token to log into the Dashboard:
kubectl -n kubernetes-dashboard create token admin-user
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.
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)