Skip to content

Dashboard

Setup Dashboard

The Dashboard UI is not deployed by default. To deploy it, run the following command:

1
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

Deploy heapster to enable container cluster monitoring and performance analysis on your cluster:

1
kubectl apply -f https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/heapster.yaml

Output:

1
2
3
serviceaccount "heapster" created
deployment "heapster" created
service "heapster" created

Deploy the influxdb backend for heapster to your cluster:

1
kubectl apply -f https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/influxdb.yaml

Output:

1
2
deployment "monitoring-influxdb" created
service "monitoring-influxdb" created

Create the heapster cluster role binding for the dashboard:

1
kubectl apply -f https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/rbac/heapster-rbac.yaml

Output:

1
clusterrolebinding "heapster" created

Create Service account

$ cat service_account.yml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kube-system

$ kubectl create -f service_account.yml
serviceaccount "admin" created

Create ClusterRoleBinding

$ cat role_binding.yml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: admin-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: admin-user
  namespace: kube-system

Get the Bearer token for admin user

$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin | awk '{print $1}')
Name:         admin-token-zkb97
Namespace:    kube-system
Labels:       <none>
Annotations:  kubernetes.io/service-account.name=admin
              kubernetes.io/service-account.uid=c2c05ae3-07de-11e8-a9e8-000c296e7dc2

Type:  kubernetes.io/service-account-token

Data
====
ca.crt:     1025 bytes
namespace:  11 bytes
token:      eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi10b2tlbi16a2I5NyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJhZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImMyYzA1YWUzLTA3ZGUtMTFlOC1hOWU4LTAwMGMyOTZlN2RjMiIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlLXN5c3RlbTphZG1pbiJ9.J7U8_VgT-RD71qWpHrCcJmp6tUY6o6RspARJefJlYcYdh2OUOik-47v7CzViZ941hs3g-g3n7w9EDFBT0aVsBmoMB2iitL6Uk4CjyZdOwgKZGaCWwKzatY2xRsjaGDL7EaxX6xHLrYCGjb7u080ba8Tm_Timuf7miuc98JOoMv5tZE34prrCdRs3P14_-YsvHFZGCYy3_kVpViK3Get9mxMlUUfrG6LFxZ6anDfKeZYv1yROHyyzbThWXu2KRhbIQqjc-1U2HQZoH3tK7GcOJKWg6RAOqwBpULkPNoa2bI4ADyOzj_uFs49Qbl6DoThERzGeSwmmvbcb0hitvce9HA

Login to the dashboard

  1. start the proxy

    $ kubectl proxy

  2. Launch browser and access the following URL:

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

  3. Use the Toekn got from the above step

Monitoring Pods

https://blog.kublr.com/how-to-utilize-the-heapster-influxdb-grafana-stack-in-kubernetes-for-monitoring-pods-4a553f4d36c9