Monitoring metrics using Kubernetes Dashboard

By default, Kubernetes Dashboard doesn't display detailed metrics unless Kubernetes Metrics Server is installed and the kubernetes-metrics-scraper sidecar container is running.

Let's first verify that all the necessary components are running, and then we will see how to access the metrics data from Kubernetes Dashboard:

  1. Verify that the kubernetes-metrics-scraper pod is running. If not, install Kubernetes Dashboard by following the instructions in the Deploying the Kubernetes Dashboard recipe in Chapter 1, Building Production-Ready Kubernetes Clusters:
$ kubectl get pods -n kubernetes-dashboard
NAME READY STATUS RESTARTS AGE
dashboard-metrics-scraper-69fcc6d9df-hhkkw 1/1 Running 0 177m
kubernetes-dashboard-566c79c67d-xqc6h 1/1 Running 0 177m
  1. On Kubernetes Dashboard, select Namespaces and click on the Overview menu. This view shows pods in that namespace with their CPU and memory utilization:

  1. On Kubernetes Dashboard, select a namespace and click on Pods in the Overview menu. This view shows the overall CPU and memory utilization of the workloads within the selected namespace:

  1. Select Nodes under the Cluster menu. This view shows nodes in the cluster with CPU and memory utilization:

If the requests and limits are set very high, then they can take up more than their expected share of the cluster.