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

New vertical format for predict #144

Merged
merged 18 commits into from
Mar 3, 2023

Conversation

michaelmdresser
Copy link
Contributor

@michaelmdresser michaelmdresser commented Feb 28, 2023

What does this PR change?

Note verticality is a little excessive when object names wrap. See jedib0t/go-pretty#261.

Does this PR rely on any other PRs?

How does this PR impact users? (This is the kind of thing that goes in release notes!)

Overhauled kubectl cost predict formatting to use less horizontal space while adding more data: resource amounts, resource prices, and % cost change.

How was this PR tested?

$ go run cmd/kubectl-cost/kubectl-cost.go predict -r michaelkc -f ./test/multi.yaml

 OBJECT                        Δ QTY  RESOURCE UNIT   COST PER UNIT     Δ COST/MO  % CHANGE 
────────────────────────────────────────────────────────────────────────────────────────────
 michaelkc deployment             +9  CPU cores           23.27 USD   +209.47 USD           
 nginx-deployment                                                                           
                                  +6  RAM GiB              3.12 USD    +18.72 USD           
                                                                                            
────────────────────────────────────────────────────────────────────────────────────────────
 kubecost deployment             +15  CPU millicores      0.023 USD     +0.35 USD           
 kubecost-cost-analyzer                                                                     
                                  +9  RAM MiB            0.0030 USD     +0.03 USD           
                                                                                            
────────────────────────────────────────────────────────────────────────────────────────────
 michaelkc deployment            -92  CPU millicores      0.023 USD     -2.14 USD   -92.00% 
 michaelkc-cost-analyzer                                                                    
                             -172.65  RAM MiB            0.0030 USD     -0.53 USD   -43.38% 
                                                                                            
────────────────────────────────────────────────────────────────────────────────────────────
 michaelkc deployment            +10  CPU cores           23.27 USD   +232.74 USD           
 nginx-deployment-2                                                                         
                                 +35  RAM GiB              3.12 USD   +109.17 USD           
                                                                                            
                                  +5  GPUs               693.50 USD  +3467.50 USD           
                                                                                            
────────────────────────────────────────────────────────────────────────────────────────────
 michaelkc pod nginx-pod        +350  CPU millicores      0.023 USD     +8.15 USD           
                                +200  RAM MiB            0.0030 USD     +0.61 USD           
                            ────────────────────────────────────────────────────────────────
                                +350  CPU millicores      0.023 USD     +8.15 USD           
                                +200  RAM MiB            0.0030 USD     +0.61 USD           
                                  +3  GPUs               693.50 USD  +2080.50 USD           
────────────────────────────────────────────────────────────────────────────────────────────
 TOTAL MONTHLY COST CHANGE                                           +6133.32 USD  

Have you made an update to documentation?

See README updates

@michaelmdresser michaelmdresser changed the base branch from main to mmd/use-new-spec-predict February 28, 2023 00:21
@michaelmdresser michaelmdresser changed the title WIP: New vertical format for predict New vertical format for predict Mar 1, 2023
Base automatically changed from mmd/use-new-spec-predict to main March 1, 2023 21:53
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Copy link

@CampfireRemnants CampfireRemnants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good to me!

@michaelmdresser michaelmdresser merged commit 1372c1b into main Mar 3, 2023
@michaelmdresser michaelmdresser deleted the mmd/predict-new-vertical-format branch March 3, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants