kubernetes-client / python

Official Python client library for kubernetes
http://kubernetes.io/
Apache License 2.0
6.71k stars 3.26k forks source link

[feat]: Integrate Kubernetes Metrics API into the Python Client #2135

Open Parvezkhan0 opened 11 months ago

Parvezkhan0 commented 11 months ago

What is the feature and why do you need it:

The feature is the integration of the Kubernetes Metrics API into the Python client. This addition will allow users to retrieve metrics data directly through the client, enabling more streamlined monitoring and auto-scaling workflows. Currently, the client lacks native support for querying metrics data, making it necessary to rely on external tools or libraries.

Describe the solution you'd like to see:

I envision the addition of a new module or extension to the existing client specifically dedicated to handling metrics data retrieval. This module should include methods for querying various types of metrics, such as pod metrics, node metrics, and custom metrics. It should also be designed to seamlessly integrate with the existing client structure, providing a consistent user experience.

The solution should ensure compatibility with different versions of Kubernetes to support users on various clusters. Additionally, comprehensive documentation and examples should be provided to guide users in effectively utilizing the new metrics functionalities.

Overall, the goal is to empower users with the ability to access and utilize metrics data directly through the Python client, eliminating the need for external dependencies and enhancing the client's capabilities in monitoring and scaling applications.

roycaihw commented 11 months ago

/help

@Parvezkhan0 Could you elaborate what Kubernetes Metrics API is?

k8s-ci-robot commented 11 months ago

@roycaihw: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to [this](https://github.com/kubernetes-client/python/issues/2135): >/help > >@Parvezkhan0 Could you elaborate what Kubernetes Metrics API is? Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
rodrigodelmonte commented 10 months ago

I believe the metrics=server is the component responsible for exposing metrics for the HPA controller or the kubectl top command.