I want to set up a Kubernetes Dashboard on an Amazon Elastic Kubernetes Service (Amazon EKS) cluster.
Resolution
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
Prerequisites:
- You must have an Amazon Elastic Compute Cloud (Amazon EC2) instance or user system with kubectl and Helm binaries.
- You must configure a kubeconfig file that points to the correct Amazon EKS cluster.
Deploy the Kubernetes Dashboard
To deploy the Kubernetes Dashboard on the Amazon EKS cluster, run the following commands:
DASHBOARD_VERSION="7.4.0"$ helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
kubectl create ns kubernetes-dashboard
helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --namespace kubernetes-dashboard --version ${VERSION}
Note: Replace DASHBOARD_VERSION with the Kubernetes Dashboard release tag value.
For more information about how to deploy the Kubernetes Dashboard, see Deploying the Dashboard UI on the Kubernetes website. To check the latest available release tags, see kubernetes/dashboard releases on the GitHub website.
Access the Kubernetes Dashboard
Complete the following steps:
- You must route all requests from the Amazon EC2 instance's local port to the Kubernetes Dashboard service port. To activate port forwarding, run the following command:
kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 --address Amazon_EC2_Private_IP
Note: Replace Amazon_EC2_Private_IP with your EC2 instance's private IP address.
- To access the Kubernetes Dashboard, open the https://Amazon_EC2_Public_IP:8443 address.
- When prompted, enter a token or kubeconfig file.
- To get a bearer token for authentication on the Kubernetes Dashboard login page, run the following get-token AWS CLI command from your local computer terminal:
aws eks get-token --cluster-name ClusterName --region Region | jq -r '.status.token'
Note: Replace ClusterName with your cluster name, and Region with your AWS Region.
- Copy the token from the terminal output.
- In the pop-up window of the Kubernetes Dashboard login page, choose Token.
- For Enter Token, enter the copied token.
- To access the Kubernetes Dashboard in your browser, choose Sign in.
Related information
kubernetes/dashboard on the GitHub website