Skip to content

Add a flag to kubectl top to include cpu/memory resource request/limits for pods and containers #1214

Open
@ethanchowell

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.

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions