Using only the Kubectl command line is sometimes not intuitive. Kubernetes offers a project called Dashboard, which provides users with a visual Web interface to view various information about the current cluster.

Users can use The Kubernetes Dashboard to deploy containerized applications, monitor application status, perform troubleshooting tasks, and manage Kubernetes resources.

Check the dashboard version compatibility with Kubernetes: github.com/kubernetes/… Find dashboard V2.0.5 compatible with our Kubernetes 1.19, ok, install it!

Perform yaml files directly deployed: kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.5/aio/deploy/recommended.yaml

In K8S, a configuration file is required to create resources. The format of the configuration file must be YAML

Of course, we can also download the yamL file, edit it and then execute it.

Check kubernetes-Dashboard application status

kubectl get pod -n kubernetes-dashboard

Enable the API Server access proxy

kubectl proxy

Access the Kubernetes Dashboard at the following URL

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

Configure the console access token

For the Mac environment

TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}') kubectl config set-credentials docker-for-desktop --token="${TOKEN}" echo $TOKEN

For Windows

$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1] kubectl config set-credentials docker-for-desktop --token="${TOKEN}" echo $TOKEN

When logging into the Dashboard, select the token

Enter the console output above

Or select Kubeconfig file, the path is as follows:

Mac: $HOME/.kube/config Win: %UserProfile%.kube\config

Click login to enter the Kubernetes Dashboard