Menu Close

Install Kubernetes metrics API for kind cluster

This post shows how to install Kubernetes metrics API for kind clusters.

kind is a tool to create a local multi-node Kubernetes cluster based on a container runtime environment like docker. Unlike minikube, kind only creates a very minimalistic Kubernetes cluster. A lot of components like the Kubernetes metrics API server are not installed by default. The Kubernetes metrics server is required for the “kubectl top” command to work.

How to install Kubernetes metrics API for kind clusters

First start the kind cluster:

kind create cluster

After the cluster is created, install the metrics server using helm:

helm repo add metrics-server
helm repo update
helm upgrade --install --set args={--kubelet-insecure-tls} metrics-server metrics-server/metrics-server --namespace kube-system

Monitor that the metrics server for kind was created and reaches the running state:

k get pods -n kube-system -w

You can now run “kubectl top” commands to monitor your pods.