cloudbud
cloudbud

Reputation: 3288

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

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

Upvotes: 1

Views: 568

Answers (1)

Patrick
Patrick

Reputation: 169

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}'

Upvotes: 2

Related Questions