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
How to get pod monitoring information from SDK? #528
Comments
What kind of information do you need? |
Pod's CPU, memory, hard disk usage and more. |
There are not such things in standard API. Please take a look at projects: heapster (deprecated), metric-server, cAdvisor and kube-state-metrics. |
Does the Python API support raw queries to the Kubernetes API? If I have the metric-server installed and want to make a raw query to Kubernetes API like: get --raw /apis/metrics.k8s.io/v1beta1/pods/ Issue: metrics-server endpoint #474 |
@P6rguVyrst yes, it should be possible. Try to use something like this:
https://github.com/kubernetes-client/python/blob/master/kubernetes/client/api_client.py#L278 |
minikube version: v0.28.2 Any chance I'm doing something wrong? metrics_url = '/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/kube-controller-manager-minikube'
when I make the same call via curl, it returns the expected data. |
FYI, I found: .request instead of .call_api This Works! |
@mward29 how did you include config parameters here, like the ones from |
yes. config.load_kube_config() |
FYI. I had to add the full url to make it work. Still unable to get .call_api to work. metrics_url = 'https://192.168.99.100:8443/apis/metrics.k8s.io/v1beta1/namespaces/kube-system/pods/kube-controller-manager-minikube' |
@mward29 i think go get .call_api to work you have to define at least response_type , but i did not find any suitable type in https://github.com/kubernetes-client/python/tree/master/kubernetes/client/models |
with
i get
|
i do it now this way:
|
Nice Shinzu |
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-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@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. |
How to get pod monitoring information from SDK?
The text was updated successfully, but these errors were encountered: