facebook

Setup of Kubernetes Dashboard and its use cases

Posted By : Karan

Apr 29, 2023

Introduction


Kubernetes is a powerful platform for managing containerized applications, but it can be challenging to manage without the right tools and skilled devops engineers. Kubernetes Dashboard is a web-based graphical user interface (GUI) that allows you to manage and monitor Kubernetes clusters.

It is an open-source project which is managed by the Kubernetes community. We can also create, update and delete Kubernetes resources. The best thing is that we can monitor the metrics and logs of the pods directly in the dashboard with a very user-friendly interface, which can also be helpful for troubleshooting and performance monitoring. 

Installing Kubernetes Dashboard

 

Ensure your Kubernetes Cluster is Up and running, also you must have kubectl (Kubernetes command line utility) installed and connected to your cluster.
 

Execute the following command, it will deploy all the necessary resources in order to start the dashboard.

 

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

 

Now you can check the resources in kubernetes-dashboard namespace by using following command:

 

kubectl get all -n kubernetes-dashboard

 

You can access the dashboard by port forwarding the pod or by editing its service type. Right now it is of CluterIP. You can set it to NodePort or LoadBalance.
We will use port forwarding , but before that, we will create a service account and cluster role binding to give it a cluster admin role.

 

You can use the following commands for that:-

 

kubectl create serviceaccount dashboard -n kubernetes-dashboard

 

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

 

Now the last step would be to port forward the dashboard pod by using the following command:

 

kubectl -n kubernetes-dashboard port-forward kubernetes-dashboard-7979bc45d5-zpm85 8090:8443 --address 0.0.0.0
 

Now you can access the dashboard in your localhost 8090 port.

 


 

 

For the token, you can get the secret using the following command.

 

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

 

Now you can easily manage and monitor your kubernetes resources by using the dashboard.

 


 

 

Some of the key use cases of Kubernetes Dashboard include:

 

  1. Resource Management: Kubernetes Dashboard allows you to easily create, update, and delete Kubernetes resources, such as pods, services, and deployments, among others.
  2. Monitoring and Logging: Kubernetes Dashboard provides a user-friendly interface for viewing logs and metrics from various Kubernetes resources, making it a useful tool for troubleshooting and performance monitoring.
  3. Security: Kubernetes Dashboard includes built-in RBAC capabilities, allowing you to control access to your Kubernetes cluster based on user roles and permissions.
  4. Application Deployment: Kubernetes Dashboard can be used to deploy and manage applications on your Kubernetes cluster, making it an essential tool for DevOps teams.

 

Conclusion

 

Kubernetes Dashboard is a powerful tool for managing and monitoring Kubernetes clusters. With its intuitive interface and built-in RBAC capabilities, it makes managing Kubernetes resources easy and secure. By following the steps outlined in this blog post, you can quickly set up Kubernetes Dashboard and start exploring its many use cases.

Leave a

Comment

Name is required

Invalid Name

Comment is required

Recaptcha is required.

blog-detail

December 13, 2024 at 09:22 pm

Your comment is awaiting moderation.

By using this site, you allow our use of cookies. For more information on the cookies we use and how to delete or block them, please read our cookie notice.

Chat with Us
Telegram Button
Youtube Button

Contact Us

Oodles | Blockchain Development Company

Name is required

Please enter a valid Name

Please enter a valid Phone Number

Please remove URL from text