
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
- We have already installed and configured the 2 Node cluster in our demo environment.
- Please check the URL https://blog.assistanz.com/steps-to-install-kubernetes-cluster-manually-using-centos-7/ for more information.
INSTALLING DASHBOARD
- Log in to the kubernetes master server through putty.

- 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

- It will take few seconds to complete the installation.

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

- 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

- Apply the full admin privileges to dashboard service account using the dashboard-admin YAML file.
kubectl create -f dashboard-admin.yaml

- It will take few seconds to apply the settings.

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

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.

- You can verify process status using the below command.

- You can delete the process using the kill command.
kill -9 <process ID>
Example: kill -9 6114

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/

- 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.

- Now we will able to view the homepage of the 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