Kubernetes dashboard is a web-based user interface which provides information on the state of the Kubernetes cluster resources and any errors that may occur. The dashboard can be used to deploy containerized applications to the cluster, troubleshoot deployed applications, as well as the general management of the cluster resources.

The deployment of Deployments, StatefulSets, DaemonSets, Jobs, Services and Ingress can be done from the dashboard or from the terminal with kubectl. if you want to scale a Deployment, initiate a rolling update, restart a pod, create a persistent volume and persistent volume claim, you can do all from the Kubernetes dashboard.

Also checkout the article on Authenticate Kubernetes Dashboard Users With Active Directory

Step 1: Configure kubectl

We’ll use the kubectl kubernetes management tool to deploy dashboard to the Kubernetes cluster. You can configure kubectl using our guide below.

Easily Manage Multiple Kubernetes Clusters with kubectl & kubectx

The guide in the link demonstrates how you can configure and access multiple clusters with same kubectl configuration file.

Step 2: Deploy Kubernetes Dashboard

The default Dashboard deployment contains a minimal set of RBAC privileges needed to run. You can deploy Kubernetes dashboard with the command below.

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml

This will use the default values for the deployment. If you want to make some modifications to the file, you’ll have to download it to your local machine.

wget https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml
mv recommended.yaml kubernetes-dashboard-deployment.yml

Modify the file to fit your deployment needs.

vim kubernetes-dashboard-deployment.yml

I’ll modify the Kubernetes dashboard service to be of NodePort type.

kind: Service
apiVersion: v1
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kubernetes-dashboard
    - port: 443
      targetPort: 8443
    k8s-app: kubernetes-dashboard
  type: NodePort
  • NodePort exposes the Service on each Node’s IP at a static port (the NodePort). A ClusterIP Service, to which the NodePort Service routes, is automatically created.

Apply the changes when done:

kubectl apply -f kubernetes-dashboard-deployment.yml

Check deployment status:

$ kubectl get deployments -n kubernetes-dashboard                              
NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
dashboard-metrics-scraper   1/1     1            1           86s
kubernetes-dashboard        1/1     1            1           86s

Two pods should be created – One for dashboard and another for metrics.

$ kubectl get pods -n kubernetes-dashboard
NAME                                         READY   STATUS    RESTARTS   AGE
dashboard-metrics-scraper-7b64584c5c-xvtqp   1/1     Running   0          2m4s
kubernetes-dashboard-566f567dc7-w59rn        1/1     Running   0          2m4s

Since I changed service type to NodePort, let’s confirm if the service was actually created.

$ kubectl get service -n kubernetes-dashboard       

NAME                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
dashboard-metrics-scraper   ClusterIP    <none>        8000/TCP        2m59s
kubernetes-dashboard        NodePort   <none>        443:30038/TCP   3m

Step 3: Accessing Kubernetes Dashboard

My Service deployment was assigned a port 30038/TCP. Let’s confirm if access to the dashboard is working.

install kubernetes dashboard 01

You need a token to access the dashboard, check our guides:

How To Create Admin User to Access Kubernetes Dashboard

Create Kubernetes Service / User Account restricted to one Namespace

You should see a web dashboard which looks similar to below.

install kubernetes dashboard 02

Nginx Ingress:

apiVersion: extensions/v1beta1
kind: Ingress
  name: k8s-dashboard
  namespace: kubernetes-dashboard
    nginx.ingress.kubernetes.io/secure-backends: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    - hosts:
      - k8sdash.mydomain.com
      secretName: tls-secret
    - host: k8sdash.mydomain.com
        - path: /
            serviceName: kubernetes-dashboard
            servicePort: 443

Kubernetes Learning courses:

Check other Kubernetes guides:

Top Minimal Container Operating Systems for running Kubernetes

Install Production Kubernetes Cluster with Rancher RKE

Install Minikube Kubernetes on CentOS 8 / CentOS 7 with KVM

How To Schedule Pods on Kubernetes Control plane (Master) Nodes

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here