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
Crossplane top command - pods resources utilization implementation #5245
Conversation
1d7a9ad
to
99ba9a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick pass, maybe some comments are uneccesary as I know its a WIP, but added them just in case.
124ab38
to
bfd4be7
Compare
bfd4be7
to
c865430
Compare
@Piotr1215 Could you please update the PR description with an example or two, showing what it's like to use the command? |
+1 to this as I'm actually having trouble testing this PR myself. I built from your branch/fork, installed Crossplane with
Is there more config I need to do to enable the metrics and get the |
@negz @jbw976 thank you for the reviews. I have clarified the command usage in PR description and updated command help with examples. In order for the command to work, the The error you have seen @jbw976 is a bit unfortunate because it can mean that the I've marked as resolved the suggestions that are implemented/fixed. The ones still open have some open questions/comments. I think adding more tests would also be a good idea :) |
98c15f5
to
e314338
Compare
6984151
to
13c6b15
Compare
The command filters all crossplane pods from a given namespace and displays CPU/Memory metrics similar to the kubectl top pods. Results printing comes in two variations: - default tabular view with pod type - ability to add header summary for all crossplane pods The default printer implementation uses tabwriter package to create equal spacing between the results. Signed-off-by: Piotr Zaniewski <piotr@upbound.io>
0d475e3
to
dbbf48f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome this looks like it got to a clean place to ship initial functionality!! 💪
Description of your changes
Initial implementation of the
crossplane top
command.This implementation covers running the top command to show resources utilization of crossplane pods:
Prerequisites
In order to display metrics, the
metrics-server
needs to be enabled. Prometheus is not required. Enabling metrics server like so, for example:Running the command
The
top
command behaves very similarly to thekubectl top pods
. It displays CPU and Memory utilization for Crossplane pods. By default the command will search for crossplane pods in thecrossplane-system
namespace. It's possible to use-n
or--namespace
flag to look for pods in another namespace.Running command without flags will default to a table view, sorted by pod type and pod name.
From here, it's easy to use command line utilities like
sort awk or sed
to manipulate the output.Running command with
-s
or--summary
flag will add pods summary on top of the table view:Metrics Server
Before pods can emit metrics it can take a moment for new pods to register, so transient errors like this are possible, just run the command again.
Partially Implements #5036
I have:
make reviewable
to ensure this PR is ready for review.Added or updated e2e tests.Addedbackport release-x.y
labels to auto-backport this PR.Need help with this checklist? See the cheat sheet.