I want to set up a Kubernetes Dashboard on an Amazon Elastic Kubernetes Service (Amazon EKS) cluster.
Resolution
Set up your environment
Note: If necessary, connect to your Amazon Elastic Compute Cloud (Amazon EC2) instance using SSH. The syntax in the code examples below applies to Linux servers.
1. Install kubectl and aws-iam-authenticator.
2. To configure your kubeconfig file to point to the Amazon EKS control plane, run the following command:
$ aws eks update-kubeconfig --name EKS_ClusterName
Note: Replace EKS_ClusterName with your EKS cluster name. For additional information on configuring your kubeconfig file, see update-kubeconfig.
3. To verify that worker nodes are running in your environment, run the following command:
$ kubectl get nodes
4. To verify that the Kubernetes service is running in your environment, run the following command:
$ kubectl get svc
Create a Kubernetes Dashboard
1. Complete the Step 1: Deploy the Kubernetes dashboard steps in Tutorial: Deploy the Kubernetes Dashboard (web UI).
2. Complete the Step 2: Create an eks-admin service account and cluster role binding steps in Tutorial: Deploy the Kubernetes Dashboard (web UI).
3. To forward all requests from your Amazon Elastic Compute Cloud (Amazon EC2) instance localhost port to the Kubernetes Dashboard port, run the following command:
$ kubectl port-forward svc/kubernetes-dashboard -n kubernetes-dashboard 6443:443
Access the Kubernetes Dashboard in a browser
1. To access your Kubernetes Dashboard in a browser, enter https://127.0.0.1:6443.
Note: The Kubernetes Dashboard loads in the browser and prompts you for input.
2. To get a bearer token for authentication (from the Kubernetes website), return to the command line, and run the following command:
$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}')
3. Copy the token from the command line output.
4. In your browser, in the Kubernetes Dashboard pop-up window, choose Token.
5. Paste the token from the output into the Enter token box, and then choose SIGN-IN.
You now have access to the Kubernetes Dashboard in your browser.
Related information
Kubernetes Dashboard on GitHub