-
Notifications
You must be signed in to change notification settings - Fork 56
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 support for cost difference in "predict" using new API #141
Conversation
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
85c4be4
to
f6637ae
Compare
Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
f6637ae
to
0777015
Compare
Super cool! cc @kwombach12 for UX feedback but lgtm! |
@michaelmdresser very cool. The data is readable and well-presented. |
I suggest we explicitly state that it's the diff if we're showing this by default... i.e. we could have one sentence before the table showing something like: "Expected monthly cost change is as follows:" vs "Expected monthly total cost is as follows:" Thoughts? |
The table shows both total cost and cost change on two resources: cpu and memory. If you think the delta symbol isn't universal enough to convey "difference" we can think up something to address it. I mainly want to avoid cluttering up the terminal output, as IMO its better for tools like this to be straight to the point with useful |
I see your point. I think some users may either miss or not understand the user of delta. One reason for the latter might be that it's not applied to "Total/Mo" Column. Should that be changed to Diff/Mo? |
The current predict API only diffs CPU and memory but I'm hoping it will be straightforward to address this UX shortcoming once I finish the better predict API, incorporating what we've learned. |
What does this PR change?
See release note. Diff behavior matches the current diff used by our new Admission Controller.
How does this PR impact users? (This is the kind of thing that goes in release notes!)
kubectl cost predict
. The default behavior will attempt to match workload specs with existing workloads tracked by Kubecost and will calculate a cost diff based on resource request. Disable with--no-diff
.kubectl cost predict
workload name output. If a namespace is not set on a given workload, it will be inherited from your Kubeconfig context.How was this PR tested?
test/multi.yaml
file. Observed full cost diffs on dev cluster (KC deployed in nonstandard namespace) and a true diff on the nightly cluster, as expected.Have you made an update to documentation?
Yes, README update in this PR.