In this section, we will configure our Kubernetes cluster to get core metrics, such as CPU and memory. You will learn how to monitor Kubernetes metrics using the built-in Kubernetes tools both in the CLI and on the UI.
Make sure you have a Kubernetes cluster ready and kubectl configured to manage the cluster resources.
Clone the k8sdevopscookbook/src repository to your workstation to use the manifest files in the chapter8 directory:
$ git clone https://github.com/k8sdevopscookbook/src.git
$ cd /src/chapter8
The Monitoring metrics using Kubernetes Dashboard recipe requires Kubernetes Dashboard v2.0.0 or later to function. If you want to add metric functionality to the dashboard, make sure that you have Kubernetes Dashboard installed by following the instructions in the Deploying Kubernetes Dashboard recipe in Chapter 1, Building Production-Ready Kubernetes Clusters.
How to do it…
This section is further divided into the following subsections...