How to install and access Kuberntes Dashboard
Kubernetes is great, but it is mostly command line and YAML manifests. Kubernetes Dashboard is an easy way to visualize every nook and cranny of your Kubernetes Cluster, let’s take a look at how to install it.
Prerequisites
I will assume you have:
- A functioning Kubernetes cluster (Don’t have one? Check this tutorial for starters.)
- You have installed kubectl on your machine.
- You have configured kubectl to communicate with your cluster.
Installing Kubernetes Dashboard
Installing Kubernetes Dashboard is surprisingly easy:
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
After a few minutes you will have a functioning dashboard, but how to access it? Firstly do:
$ kubectl proxy
This will create a secure tunnel between you and your Kubernetes cluster. You can now access the dashboard through this address: http://localhost:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard:/proxy/.
How to access Kuberntes Dashboard
If you have RBAC set up in your cluster, chances are you will face the screen above.
In this case you will need a Bearer Token to access the Dashboard. To get it you can use the following oneliner:
$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep kubernetes-dashboard-token | awk '{print $1}') | grep 'token:' | awk -F " " '{print $2}'
In case you get a list of multiple strings, you don’t have a secret named “kubernetes-dashboard-token”, meaning you haven’t installed the dashboard correctly.
- 2020 A year in review for Marksei.com - 30 December 2020
- Red Hat pulls the kill switch on CentOS - 16 December 2020
- OpenZFS 2.0 released: unified ZFS for Linux and BSD - 9 December 2020
Recent Comments