Home > Software engineering >  How can I find cpu and memory limits along with the app-name in kubernetes
How can I find cpu and memory limits along with the app-name in kubernetes

Time:08-26

I executing a command that give me cpu limit

kubectl get pods -o=jsonpath='{.items[*]..resources.limits.cpu}' -A

How can I modify the command to show pod name and the memory limit also

CodePudding user response:

You can format the jsonpath like this.

kubectl get pods -Ao jsonpath='{range .items[*]}{"name: "}{@.metadata.name}{" cpu: "}{@..resources.limits.cpu}{" memory: "}{@..resources.limits.memory}{"\n"}{"\n"}{end}'
  • Related