-
Notifications
You must be signed in to change notification settings - Fork 60
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
Last month Usage for chargeback ( internal billing ) #58
Comments
Hi @NM4, this is absolutely doable and I think it's a great idea. I'll see what I can do. |
The window flag is equivalent to the window parameter for the official APIs. I have a PR #61 now open to improve the documentation on that front. For your specific use case, you can try Does that help? |
Oh yes thank you ! Sorry I tried with last-month instead of lastmonth. So you confirm that In other hand, is this based on requests or real resource consumption ? |
If you make that This data is based on real resource consumption, which we calculate as the maximum of requests and actual usage. We have a small section in the main repo's FAQ that explains this in brief. We also have explanations of the metrics we emit (which the APIs are based on) here. |
@NM4 did that suggestion give you what you need? @michaelmdresser i can see about updating docs if so! |
Absolutely Yes. |
Sounds good, @NM4 any other valuable features that we can look at adding for you?! |
I'm looking for the cost per namespace as asked in this thread but additionally with a label attached to namespaces that should be charge backed to teams. Something like a label "tobill=yes" that give this information. |
@NM4 we would be able to aggregate by namespace label. We apply all namespace labels to any workload running in that namespace. Example uses would be something like these:
Does that meet you need or are you looking to do something else? |
yes something like that but with cost aggregated by namespace and only the namespaces that has the label are returned
|
Ok, cool, this sounds like our concept of filtering! This is available in the backing API that the plugin uses. We would just want to think through the best way to expose on kubectl. Something like this seems to make sense to me?
Modeling after field selector syntax -- https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/ Let us know what you think @NM4 and @michaelmdresser! We could open a new issue if this sounds like the right direction. |
Yes it's exactly a filtering feature. In my case, it would be nice if the aggregated costs are displayed by namespace ( by default all namespaces that has the label) |
I absolutely like this idea. As for the specific case (only displaying namespaces that have a certain label) I don't believe the backing Kubecost APIs actually support this, unless @dwbrown2 knows differently. We can do other kinds of filtering, like if you have a list of namespaces that you want to view a subset of: I could imagine a world where you use a regular
If that sounds like a good idea, I've opened #65 where we can continue discussion. |
Hello,
Is there a way to get last month data for CPU, RAM and disk in term of usage or request ?
I'm wondering to use kubectl-cost with Kubecost core model to do that but for now, I don't found a way to pass information about the window range with a start and end date. Something like :
Kubectl cost --historical --start-date xxx --end-date yyy
The text was updated successfully, but these errors were encountered: