Add a flag to kubectl top
to include cpu/memory resource request/limits for pods and containers #1214
Open
Description
What would you like to be added:
An additional command line flag that, when enabled, adds the resource request and limits defined in the container manifest.
$ kubectl top pods --enumerate # or some other flag like '-o wide'
NAME CPU(cores) MEMORY(bytes) CPU REQ(cores) MEMORY REQ(bytes) CPU LIMIT(cores) MEMORY LIMIT(bytes)
my-pod-1 15m 10Mi 10m 5Mi 30m 15Mi
my-pod-2 15m 10Mi 10m 5Mi 30m 15Mi
my-pod-3 3m 5Mi 10m 5Mi 30m 15Mi
This flag should also be compatible with --containers
and specifying a pod name.
Why is this needed:
I mostly operate in an on-prem cluster with our own hardware, and we don't utilize horizontal scaling for a handful of our deployments just due to the nature of their design. I.e. we find ourselves restricted for resources more often than not. Adding this flag to show the configured resource requests and limits would save a ton of time bouncing back and forth between kubectl top pods
and kubectl get pod ...
to compare the two.