0

How to get the limits.cpu value from kubernetesClient object. I need to check the cpu quota before creating a new pod in kubernetes. (JAVA)

I came across Client.top.node... but I need some equivalent of Kubectl describe quota

Basic ask is to check if there is 100mi of quota left before creating a pod

  • 1
    if you set `100mi` as the requested CPU in pod resource definition it will create only pod when there is quota available to assign to that pod. – Harsh Manvar Jan 17 '23 at 09:11
  • My requirement is to trigger a mail to admins if the space is decreasing. So want to read values in the resources quota – Tanya Bhandari Jan 17 '23 at 09:30
  • not java guy but might be helpful : https://www.tabnine.com/code/java/methods/io.fabric8.kubernetes.client.KubernetesClient/resourceQuotas – Harsh Manvar Jan 17 '23 at 09:43

0 Answers0