Add savings subcommand for request sizing recommendations#224
Open
pierluigilenoci wants to merge 2 commits intokubecost:mainfrom
Open
Add savings subcommand for request sizing recommendations#224pierluigilenoci wants to merge 2 commits intokubecost:mainfrom
pierluigilenoci wants to merge 2 commits intokubecost:mainfrom
Conversation
Adds `kubectl cost savings` which queries the Kubecost /model/savings/requestSizingV2 API and displays container-level request sizing recommendations with estimated monthly savings. Closes kubecost#84 Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
- Add unit tests for MakeSavingsTable and WriteSavingsTable covering empty input, single record, multiple records with sort order, and total calculation - Fix descending sort by pre-sorting the recommendations slice instead of relying on go-pretty's DscNumeric which doesn't work correctly with Transformer-formatted values - Add savings command to integration test script Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
Author
|
@michaelmdresser @kaelanspatel @cliffcolvin could you please take a look at this PR when you get a chance? Thanks! |
Author
|
Gentle ping — this PR has been open for over a week now. Could someone take a look when you get a chance? Happy to address any feedback. Thank you! |
Author
|
Hi @michaelmdresser, @kaelanspatel, @cliffcolvin -- friendly follow-up. CI is green and this PR has been waiting for review for a few weeks now. Would love to get this moving forward. Happy to address any feedback or make adjustments. Thank you! |
Author
|
Hi @thomasvn — friendly ping on this PR which adds a savings subcommand for request sizing recommendations. Happy to address any feedback or make changes. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kubectl cost savingssubcommand that queries the Kubecost/model/savings/requestSizingV2API--windowflag (default2d) and standard query backend flagsNew files
pkg/query/savings.go— query layer for the savings/requestSizingV2 APIpkg/cmd/display/savings.go— table rendering with go-pretty (sorted by savings descending, total in footer)pkg/cmd/savings.go— cobra command with options struct, Complete/Validate/Run lifecycleModified files
pkg/cmd/cost.go— registers the newsavingssubcommandExample output columns
Closes #84
cc @dwbrown2 @michaelmdresser