Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add NODE info for kubectl top pod output #1706

Open
qyecst opened this issue Jan 29, 2025 · 10 comments · May be fixed by kubernetes/kubernetes#130525
Open

add NODE info for kubectl top pod output #1706

qyecst opened this issue Jan 29, 2025 · 10 comments · May be fixed by kubernetes/kubernetes#130525
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/cli Categorizes an issue or PR as relevant to SIG CLI. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@qyecst
Copy link

qyecst commented Jan 29, 2025

What would you like to be added:

Hi team, I want to add NODE info for kubectl top pod output like

NAME                   NODE     CPU(cores)   MEMORY(bytes)   
db-5977df8496-p8s2f    node1    1m           57Mi
one-d48cbd8b8-znqcx    node2    2m           1Mi
two-55445bbdb9-bt72c   node3    5m           2Mi

Why is this needed:
Convenient to view the pod status of the specified node: kubectl top pod |grep node-name

Convenient to check the load and node distribution of pods: kubectl top pod -l app=label

When sudden surge in node load, convenient to check the status of the corresponding pods.


The current output does not include node information. When we need to handle high-load pods or pods on high-load nodes, we need to use the kubectl get command to obtain the node where the pod is located.

This involves many additional commands and operations, such as handling and merging information from get pod and get podmetrics.

Using Prometheus for information aggregation is a solution, but it still takes a lot of time to pass pod names between Prometheus and the terminal when you need to operate on pods, especially when there are many pods involved.

@qyecst qyecst added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 29, 2025
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 29, 2025
@qyecst
Copy link
Author

qyecst commented Jan 30, 2025

I have worked on this feature and ready to contribute my implementation via a pull request.

@qyecst
Copy link
Author

qyecst commented Jan 30, 2025

/sig cli

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Jan 30, 2025
@Ritikaa96
Copy link
Contributor

Ritikaa96 commented Jan 30, 2025

@kubernetes/sig-cli-kubectl-maintainers
tagging for triaging

@googs1025
Copy link
Member

Maybe we should listen to some use cases. I don't know the necessary relationship of adding node info. Although feature is not big, we should not provide feature without describing clearly.

@qyecst
Copy link
Author

qyecst commented Feb 4, 2025

What would you like to be added:

Hi team, I want to add NODE info for kubectl top pod output like

NAME                   NODE     CPU(cores)   MEMORY(bytes)   
db-5977df8496-p8s2f    node1    1m           57Mi
one-d48cbd8b8-znqcx    node2    2m           1Mi
two-55445bbdb9-bt72c   node3    5m           2Mi

Why is this needed: Convenient to view the pod status of the specified node: kubectl top pod |grep node-name

Convenient to check the load and node distribution of pods: kubectl top pod -l app=label

When sudden surge in node load, convenient to check the status of the corresponding pods.

The current output does not include node information. When we need to handle high-load pods or pods on high-load nodes, we need to use the kubectl get command to obtain the node where the pod is located.

This involves many additional commands and operations, such as handling and merging information from get pod and get podmetrics.

Using Prometheus for information aggregation is a solution, but it still takes a lot of time to pass pod names between Prometheus and the terminal when you need to operate on pods, especially when there are many pods involved.

@kubernetes/sig-cli-kubectl-maintainers
Hi, i added some use cases, please tagging for triaging

@mpuckett159
Copy link
Contributor

/triage accepted
With the caveat that this new view is triggered by a flag such as -o wide which is similar to the get subocmmand flag.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 26, 2025
@Ritikaa96
Copy link
Contributor

The implementation will be similar to kubernetes/kubernetes#126529
I'll like to contribute this feature.

@googs1025
Copy link
Member

I have worked on this feature and ready to contribute my implementation via a pull request.

Maybe @qyecst has already invested himself in this work. Are you still involved in it?

@qyecst
Copy link
Author

qyecst commented Feb 27, 2025

@googs1025 Yes, but needs to be modified to use a flag like -o wide, probably this weekend.

@googs1025
Copy link
Member

/assign @qyecst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/cli Categorizes an issue or PR as relevant to SIG CLI. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants