Metrics Server in Kubernetes

If you are using Minikube, this command will enable Metrics Server:

minikube addons enable metrics-server
For the others, you need to clone the repo and deploy the metric-server separately:
git clone https://github.com/kubernetes-incubator/metrics-server.git
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
Once deployed - give the Metrics Server time to collect and process data. Once processed the cluster performance can be viewed by the commands:
kubectl top node
kubectl top pod
How the statistics are gathered: Kubernetes runs an agent on each node known a s kubelet which is responsible for receiving instructions from Kubernetes API master server and running Pods on the nodes. The kubelet also contain a subcomponent known as cAdvisor which is reponsible for receiving performance metrics from Pods and expose them to the kubelet API and make them available for the Metrics Server.