How to Run the Kubernetes Dashboard Locally

Kubernetes comes with a pretty nice dashboard to view clusters, worker groups, nodes and pods. As well as a ton of other useful things.

This tutorial presumes that you already have a Kubernetes cluster setup and running and have access to it through kubectl in your command-line.

Steps to run Kubernetes Dashboard

Start by downloading the metrics-server and applying it to your kubectl config.

DOWNLOAD_URL=$(curl -Ls "" | jq -r .tarball_url)
DOWNLOAD_VERSION=$(grep -o '[^/v]*$' <<< $DOWNLOAD_URL)
curl -Ls $DOWNLOAD_URL -o metrics-server-$DOWNLOAD_VERSION.tar.gz
mkdir metrics-server-$DOWNLOAD_VERSION
tar -xzf metrics-server-$DOWNLOAD_VERSION.tar.gz --directory metrics-server-$DOWNLOAD_VERSION --strip-components 1
kubectl apply -f metrics-server-$DOWNLOAD_VERSION/deploy/1.8+/

Next, we will start setting up the metrics-server, ready for action!

kubectl get deployment metrics-server -n kube-system

Now apply the recommended configuration directly to your local kubectl:

kubectl apply -f

At this stage, we need to create a eks-admin-service-account.yaml. Once you have done this, put the following code in the newly created file:

apiVersion: v1
kind: ServiceAccount
  name: eks-admin
  namespace: kube-system
kind: ClusterRoleBinding
  name: eks-admin
  kind: ClusterRole
  name: cluster-admin
- kind: ServiceAccount
  name: eks-admin
  namespace: kube-system

We are now able to apply this configuration to our local kubectl:

kubectl apply -f eks-admin-service-account.yaml

Next, we will need to query the system to get an authorization token which we will use to login to the dashboard:

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}')

This command will print out a whole bunch of stuff. It will look something like this:

Name:         eks-admin-token-hdwhb
Namespace:    kube-system
Labels:       <none>
Annotations: eks-admin


ca.crt:     1025 bytes
namespace:  11 bytes
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJla3MtYWRtaW4tdG9rZW4taGR3aGIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZWtzLWFkbWluIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiYWRmNDZhNzYtNWUwNC0xMWVhLWI4M2MtMGE2aaaaaaaaaTHISISNOTREALaaaaaaacnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmVrcy1hZG1pbiJ9.IvE5iqK28jzi5L5DfsdGXA3I37CRQg8osNxpFegrLsCTFHDwmuFjX4Xey5a9P5Ombv8ZiYXPr_BWD49cx_hREy3Kbd6xf8NrSwr6rewPnVGejaD7k_xhl1knm2UXcDl_baOIwBUpnD1ouscRfb2ZTJTs4fri0UY9p63r7Cr8wRuZSFWLCbhqmgAWF_-JX4YcPDRwHwdFw0BoJDd3YMrBmIJ_KC8BYwo1oEucJxEfTYWWJjMbugh5hVNaVSVRwKNnrBFqSksx9iQQcPb2e_kdpobIvEQxX4-26gpRw0LfX5AXofqJ8uJelmghsn0ES8j2pqzY-x_A2_i9mEozbmXHDg

Finally, we can run the proxy command to serve the dashboard via HTTP:

kubectl proxy

How to view the dashboard

The dashboard is now available at the following location:


You will then be presented with this screen:

This is where we will select “Token” and paste in our token that was just given to us in the command-line:

Click “Sign in” and you’re ready to roll!