Install Kubernetes Dashboard - Deploy Applications using UI

This post will show you how to install kubernetes dashboard.


What is Kubernetes Dashboard?

Kubernetes Dashboard is a web-based Kubernetes user interface (Web UI) through which you can deploy your containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster resources like scaling a Deployment, initiating rolling update, restarting pods and many more.

If you are new to kubernetes and want to learn about kubernetes from basics, Refer the below links and also you can checkout all tutorial videos for free on YouTube and do subscribe for more free videos.

What is Kubernetes - Learn Kubernetes from Basics
How to Install Kubernetes on Linux (RedHat / CentOS)
How to Install Kubernetes On Ubuntu 16.04 LTS
How to Create Kubernetes Deployment, Services & Pods Using Kubectl
How to Create Kubernetes YAML for Deployment, Service & Pods
Kubernetes Volumes Explained with Examples
Kubernetes Persistent Volumes and Claims Explained

Also You can Watch this Entire Tutorial video with more examples on our YouTube Channel - Install Kubernetes Dashboard.

How to Install Kubernetes Dashboard - Deploy Applications using UI


Install Kubernetes Dashboard

Kubernetes stored their recommended yaml files in github repository. Use kubectl command to deploy the kubernetes dashboard as below.

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

By the time when we install, it has the version v2.0.0. If the version is not working or if you want to install the latest version of dashboard, checkout this repo and just replace the version. Once the above command is executed, it will create the required kubernetes resources for the dashboard as shown in the below image.

install kubernetes dashboard

How to Access Kubernetes Dashboard?

Use Kubectl proxy command, when you want to access the kubernetes dashboard only when needed and also dont want to expose the dashboard service outside the cluster. But this Dashboard can be accessed only from the node where the command is executed.

kubectl proxy

But when you want to access your kubernetes dashboard from outside the cluster then we must expose the service using LoadBalancer or NodePort type. Since default service type is Cluster IP.

how to install kubernetes dashboard

My kubernetes cluster environment is on AWS EKS, so i have changed my kubernetes dashboard service type to LoadBalancer. so that dashboard can be accessed from outside the cluster.

kubectl -n kubernetes-dashboard edit svc kubernetes-dashboard

Find the service type and change from ClusterIP to LoadBalancer, save and exit from the file.

Make sure the service type changed to LoadBalancer.

kubectl -n kubernetes-dashboard get svc

Get the ELB address from the output.

install kubernetes dashboard examples

You can access your dashboard from any browser using the ELB address you have got.

How to get Login Credentials to access Kubernetes Dashboard?

There are two ways you can login into the dashboard.

1. Kubeconfig

2. Token

Let me use token method, that is the recommended login method. For that we need to create cluster admin service account.

kubectl create serviceaccount dashboard -n default

Above command creates a service account in default namespace

kubectl create clusterrolebinding dashboard-admin -n default  --clusterrole=cluster-admin  --serviceaccount=default:dashboard

It Adds the cluster binding rules to your dashboard account that was created in default namespace.

kubectl get secret $(kubectl get serviceaccount dashboard -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode

Copy the secret token from the output and enter it in the dashboard. you will be signed into the kubernetes dashboard.


Watch this tutorial demo video on our YouTube Channel - Install Kubernetes Dashboard.


Also refer below related articles and checkout all tutorial videos for free on youtube.


إرسال تعليق

0 تعليقات