Karbon and Metrics API: A simple approach with metrics-server

Nutanix.dev - Karbon and Metrics API A simple approach with metrics-server

Table of Contents

Nutanix publishes information for initiatives that help customers integrate the Nutanix platform with other third-party products. Support for these initiatives is handled via the Nutanix community on a best-effort basis. Where open source products are referenced, support is typically provided via GitHub issues in the referenced repositories.


Introduction

In a previous article Karbon and Metrics API: A Practical Guide we have seen how to implement the Prometheus Adapter to expose all the features of the Metrics API (resource metricscustom metrics, and external metrics APIs).

In some cases like troubleshooting or simple autoscaling needs, a more basic approach may be enough.

With the release of karbon 2.4, internal architecture changes have been made and it is now even easier to install metrics-server component in a secure way.

Install Kubernetes Metrics Server

Verify the prerequisites

In order to follow this guide, you need an already deployed Karbon Kubernetes cluster.

Prism Karbon clusters view

Once the cluster is deployed, you can download the kubeconfig admin file and install it on your workstation. This can be done from the Prism graphical interface or with the karbon kubectl plugin.

This image has an empty alt attribute; its file name is image-1024x769.png
Prism UI to download Kubeconfig

Metrics Server helm chart

The preferred way to install metrics-server on Karbon is to use Helm (v3+).

Helm installation is easy by following the official documentation.

Next you need to add the metrics-server Helm repository and install the metrics-server helm chart with the right options.

helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/ && helm repo update

helm install --wait -n metrics-server --create-namespace metrics-server metrics-server/metrics-server --set replicas=2

For more information or to go deeper in metrics-server settings, visit the official documentation.

Verify metrics-server install

Waiting a few minutes, you should see the pods in the metrics-server namespace running.

You can also verify if your metrics-server is correctly integrated in the API aggregation layer.

you will see the metrics API redirecting the metrics-server service

Test the resource Metrics API

Now that your metrics-server component is installed, it is easy to test it with the kubectl top command.

Conclusion

Through this short article you have seen how extremely simple it is to start using the resources Metrics API as well as troubleshooting.

This can also be a starting point to explore the logic of Horizon Pod Autoscaling mechanism.

Related Resources

© 2024 Nutanix, Inc. All rights reserved. Nutanix, the Nutanix logo and all Nutanix product, feature and service names mentioned herein are registered trademarks or trademarks of Nutanix, Inc. in the United States and other countries. Other brand names mentioned herein are for identification purposes only and may be the trademarks of their respective holder(s). This post may contain links to external websites that are not part of Nutanix.com. Nutanix does not control these sites and disclaims all responsibility for the content or accuracy of any external site. Our decision to link to an external site should not be considered an endorsement of any content on such a site. Certain information contained in this post may relate to or be based on studies, publications, surveys and other data obtained from third-party sources and our own internal estimates and research. While we believe these third-party studies, publications, surveys and other data are reliable as of the date of this post, they have not independently verified, and we make no representation as to the adequacy, fairness, accuracy, or completeness of any information obtained from third-party sources.