Kubernetes provides a Dashboard, to allow cluster management through a user interface, certainly more intuitive than the classic command line. You can use Dashboard to deploy containerized applications on a Kubernetes cluster, troubleshoot the containerized application, and manage cluster resources. You can use the Dashboard to get an overview of the applications running on the cluster, as well as to create or modify individual Kubernetes resources. For more information, consult the official documentation Kubernetes Dashboard.
Installation
The user interface is not distributed by default. Installation is very simple, just run the following command (check the version)
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml |
Access
We need to make a small modification to a .yaml
file, via the command
...
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl -n kubernetes-dashboard get services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE dashboard-metrics-scraper ClusterIP 10.106.152.1 <none> 8000/TCP 3d kubernetes-dashboard NodePort 10.101.35.23 <none> 443:30000/TCP 3d |
Account and token
By connecting to the browser at https://<node_FIP>:<port>, in our case https://131.154.97.163:30000 (note the adoption of the protocol for secure communication with https), we could access the dashboard. There is no need to activate the VPN. The credentials entry screen will appear. As you can see, there are two ways of accessing: via token or via a configuration file. Here we deal with the first mode. However, it is advisable to try the connection to the dashboard, to make sure that the procedure carried out so far is correct.
...
Once pasted the token you enter the dashbord. The token is static, so it is recommended to save it somewhere, avoiding recovering it in the future. Below Below is an example a screenshot of the interface. You will notice some familiarity with that of Minikube.dashboard login screen.
As you can see in the image, there are 2 ways to access the dashboard: one through the token, which we have already talked about, and the other through the Kubeconfig, that is the Kubernetes configuration file that you have saved in $HOME/.kube/config
.