Is there a Java API to retrieve the CPU and Memory usage of the pod? I am not looking for a complete monitoring solution like using Grafana or Prometheus or not using the kubectl top pod, but wanted to retrieve the current usage using Java API. Any example or reference documentation on how to do will be of great help.
Client libraries
https://kubernetes.io/docs/reference/using-api/client-libraries/
Examples - https://github.com/kubernetes-client/java#installation
Similar questions:
how to get max usage of mem and cpu usage of pod on kubernetes
kubernetes Pod CPU usage in % from metric server
Thanks.