Tuesday, December 29, 2020

Kubernetes for Developers #5: Kubernetes Web UI Dashboard

 It is a web-based UI for viewing entire Kubernetes cluster information like Nodes, Deployments, Pods, Services, Jobs, Secrets etc.

It is used to deploy containers into the Kubernetes cluster and troubleshoot the containers in the K8 cluster.

It is used to create or modify individual Kubernetes resources like Deployments, Pods, Services, Jobs etc.


 Enable Web UI Dashboard using Kubectl:

Make sure Kubernetes cluster up and running before executing following kubectl commands

a) run the following command to enable Dashboard



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


Alternately, you can download same .yaml file into local computer, save as kubernetes-dashboard.yaml and run the following command

> kubectl apply -f ./kubernetes-dashboard.yaml


The above command creates dashboard deployment, service, service account, roles, role binding and secret.












b) run the following command for enabling proxy between local computer and Kubernetes Apiserver.

> Kubectl proxy


Go to the browser and hit the following url to view Web UI Dashboard login page

 http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

c) run the following command to get valid bearer token for login


> kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')






copy the bearer token and enter it into the Web UI Dashboard login page

Kubernetes dashboard has four main sections i.e.

1. Cluster:

It shows information about Nodes, Namespaces, Persistent Volumes, Roles and Storage Classes. Node list view contains CPU and memory usage metrics aggregated across all Nodes. On click of each node, it shows node status, allocated resources, events and pods running on the node.

2. Workloads:

It shows all applications running in the selected namespace including Deployments, Replica sets, Pods, Jobs, Daemon Sets, etc.

3. Discovery and Load Balancing:

It shows information about services which exposed to external world and internal endpoints within a cluster.

4. Config and Storage:

It shows information about configurations and secrets which is used for the containers. 

Kubernetes for Developers Journey.

Happy Coding :)

No comments:

Post a Comment