-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to find how to get the cpu and memory metrics per pod #1247
Comments
/assign @yliaog |
https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/ provides information about how to setup metrics pipeline to collect metrics. do you have it setup properly in you cluster? could you use kubectl to get the metrics? |
also please try using the dynamic python client, https://github.com/kubernetes-client/python-base/tree/master/dynamic |
Thank you yliaog for your response. i can fetch the metrics using kubectl without problem. The question was if i can get them via the kubernetes-client APIs. Just for helping any other developer, this is how i fetch the metrics from kubectl via my python app:
Not sure how to use the dynamic client you propose. The link you send me misses documentation. |
Any updates on this? The official client does not seem to have implementation for any apis and models for the /apis/metrics.k8s.io objects. |
could you please check out the dynamic client test code: https://github.com/kubernetes-client/python-base/blob/master/dynamic/test_client.py? it has some examples with custom resources. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Rotten issues close after 30d of inactivity. Send feedback to sig-contributor-experience at kubernetes/community. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
From this stack overflow question, here is an example of using the custom objects api to get the metrics:
|
What is the feature and why do you need it:
Current version of kubernetes client seems not to promote the access at current monitoring metrics from the ApiClient(). For example:
Instead has introduced a set of Classes making possible the interaction with k8s cluster.
I can not find how to get the current cpu,memory (or any other custom metric) values via the proposed APIs .
I see it exists the model V2beta2PodsMetricStatus which indicates the current value of a metric describing each pod in the current scale target, but i can not find with Class to use so as to acces it.
Describe the solution you'd like to see:
I would like to be able to acces the current values of all metrics of a pod or all pods.
A usage example would be really helpfull.
Thank you very much for your time and effort!
The text was updated successfully, but these errors were encountered: