To install a metrics server in Minikube, follow these steps:
- Start Minikube by running the command minikube start.
- Verify that the metrics-server addon is enabled by checking the addons list using the command minikube addons list. If it's not enabled, enable it with the command minikube addons enable metrics-server.
- Check if the metrics-server deployment is running by executing the command kubectl get deployment metrics-server -n kube-system. If it's not yet running, wait for a few moments and try again.
- To access metrics using the Kubernetes Metrics API, ensure that you have appropriate permissions. If you're using a cluster role binding that uses the "cluster-admin" role, you should have the necessary permissions. If not, create a cluster role binding using the command:
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=
- Confirm whether the metrics-server is working correctly by running the command:
kubectl get --raw /apis/metrics.k8s.io/v1beta1/nodes
If you receive metrics data for the nodes, the metrics-server is installed and running successfully.
Note: Metrics collection may take a few minutes to begin after the installation is complete, as it needs to collect data from different components of the cluster.
That's it! You have successfully installed the metrics-server in Minikube.