Steps to Install Kubernetes Dashboard

In this blog, we will show you the Steps to Install Kubernetes Dashboard in your environment.

REQUIREMENTS

  • 2 Node Cluster ( 1 Master VM with 2 Nodes)
  • Kubernetes Components

INFRASTRUCTURE OVERVIEW

INSTALLING DASHBOARD

  • Log in to the kubernetes master server through putty.
Steps to Install Kubernetes Dashboard
  • The kubernetes dashboard will not be installed by default. Use the below command to install the dashboard.

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

Steps to Install Kubernetes Dashboard
  • It will take few seconds to complete the installation.
Steps to Install Kubernetes Dashboard

CONFIGURING DASHBOARD

  • By default, the dashboard will install with minimum user role privileges.
  • To access the dashboard with full administrative permission, create a YAML file named dashboard-admin.yaml.

vi dashboard-admin.yaml

Steps to Install Kubernetes Dashboard
  • Add the below coding in the YAML file and save it.

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
   name: kubernetes-dashboard
   labels:
     k8s-app: kubernetes-dashboard
roleRef:
   apiGroup: rbac.authorization.k8s.io
   kind: ClusterRole
   name: cluster-admin
subjects:
- kind: ServiceAccount
   name: kubernetes-dashboard
   namespace: kube-system

Steps to Install Kubernetes Dashboard
  • Apply the full admin privileges to dashboard service account using the dashboard-admin YAML file.

kubectl create -f dashboard-admin.yaml

Steps to Install Kubernetes Dashboard
  • It will take few seconds to apply the settings.
Steps to Install Kubernetes Dashboard

ENABLING THE PROXY

  • From the master server, execute the below command to run the kubernetes proxy command in the background.

nohup kubectl proxy --address="192.168.3.81" -p 443 --accept-hosts='^*$' &

Steps to Install Kubernetes Dashboard

Note: We have specified the master kubernetes server IP address in the address option. It may vary based on your environment.

  • The proxy address has been added successfully.
Steps to Install Kubernetes Dashboard
  • You can verify process status using the below command.
Steps to Install Kubernetes Dashboard
  • You can delete the process using the kill command.

kill -9 <process ID>

Example: kill -9 6114

Steps to Install Kubernetes Dashboard

ACCESSING THE DASHBOARD

  • Open the web browser from your local PC and access the below URL.

http://192.168.3.81:443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

Steps to Install Kubernetes Dashboard
  • We can able to access the dashboard through the kubeconfig file or bearer token. We have already provided full admin access to dashboard service account. So just click on SKIP option to access the dashboard.
Steps to Install Kubernetes Dashboard
  • Now we will able to view the homepage of the kubernetes dashboard.
Steps to Install Kubernetes Dashboard

EXTERNAL LINKS

https://stackoverflow.com/questions/46664104/how-to-sign-in-kubernetes-dashboard

https://stackoverflow.com/questions/36270602/how-to-access-kubernetes-ui-via-browser

https://github.com/kubernetes/dashboard/wiki/Access-control#basic

https://kubernetes.io/docs/admin/authentication/

https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/

VIDEO

Thanks for reading this blog. we hope it was useful for you to learn about installing dashboard on the kubernetes environment.

Loges

Leave a Reply

Your email address will not be published. Required fields are marked *