Installation of kubernetes dashboard

Steps to Install Kubernetes Dashboard

Requirements

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

Infrastructure Overview

  • In the process of installing the kubernetes dashboard, we need to install and configure the 2-node cluster in our environment. Here, we had already installed and configured in our demo environment.
  • To learn how to install & configure the clusters visit our blog where we explain the step-by-step process of installation and configuration of clusters.

Installing Kubernetes Dashboard

  • Firstly, we need to log in to the master server through Putty.
Installation of kubernetes dashboard
  • As the kubernetes dashboard will not be installed in our environment by default, use the link to install it.
Steps to Install Kubernetes Dashboard
  • Don’t be in a hurry as it will take some time to get installed.
Installation of kubernetes dashboard

Configuring Kubernetes dashboard

  • Bravo! we had installed our kubernetes dashboard in our environment.
  • But, for your info, the dashboard will get installed with minimum user role privileges only.
  • To access the dashboard with full administration, we need to create a YAML file with the name dashboard-admin.yaml.

vi dashboard-admin.yaml

Installation of 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

Installation of kubernetes dashboard
  • Apply the full admin privileges to the dashboard service account using the dashboard-admin YAML file.

kubectl create -f dashboard-admin.yaml

Installation of kubernetes dashboard
  • It will take a few seconds to apply the settings.
Installation of kubernetes dashboard

  • 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='^*$' &

Installation of kubernetes dashboard

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

  • Hurray! The proxy address has been added successfully.
Installation of kubernetes dashboard
  • Now, you can verify the process status using the below command.
Installation of kubernetes dashboard
  • In case you want to delete the process use the following kill command.

kill -9 <process ID>

Example: kill -9 6114

Installation of 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/

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

Video Tutorial

Thank you for taking the time to read our blog on “How To Install K8s Dashboard? – A Simple Guide“. We hope you found the information valuable and insightful. If you find any issues with the information provided in this blog don’t hesitate to contact us (info@assistanz.com).

View Post>>

View Post>>