Kubernetes pods metrices through kubernetes-client library

9/4/2020

I want to fetch the kubernetes CPU utilization and memory usage data points for last 7 days using kubernetes-client library for node js.

I'm using godaddy's kubernetes client library.

https://github.com/godaddy/kubernetes-client

Which function should I call to get pods metrices details?

-- Radhe9254
kubernetes
podspec

1 Answer

9/21/2020

You shouldn't try to query stuff like CPU utilization and memory usage from the kubeernetes API.
Instead, you should query cAdvisor for that. They have a go client you can use to query the metrics directly, but it's more conventional to install prometheus on your cluster and query metrics from there.

-- Yaron Idan
Source: StackOverflow