EKS Dashboard Setup Guide
This guide walks you through installing and accessing the Kubernetes Dashboard on your Amazon EKS cluster.
1. Deploy Kubernetes Dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml2. Create Admin Service Account & ClusterRoleBinding
Save the following as eks-admin-service-account.yaml:
apiVersion: v1
kind: ServiceAccount
metadata:
name: eks-admin
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: eks-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: eks-admin
namespace: kube-systemApply the file:
kubectl apply -f eks-admin-service-account.yaml3. Create a Token Secret for the Admin Account
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: eks-admin-token
namespace: kube-system
annotations:
kubernetes.io/service-account.name: eks-admin
type: kubernetes.io/service-account-token
EOF4. Retrieve the Dashboard Access Token
kubectl -n kube-system get secret eks-admin-token -o jsonpath='{.data.token}' | base64 --decode(Optional: Save to a file)
kubectl -n kube-system get secret eks-admin-token -o jsonpath='{.data.token}' | base64 --decode > /tmp/eks_token.txt5. Start kubectl Proxy
kubectl proxy6. Access the Dashboard
Open the following URL in your browser:
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/Login using the token obtained in Step 4.
✅ Done!
You should now have access to the Kubernetes Dashboard for your EKS cluster.