-
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
Add node subcommand #95
Conversation
Awesome!! Have a couple questions/thoughts:
|
The trouble with this is that each asset type has different fields. We could certainly do |
That would still be useful to me... if you could show asset name, type,
cost. Not something we need to explore now, but just throwing it out there.
Webb
Kubecost, Co-founder
ᐧ
…On Thu, Jun 10, 2021 at 8:05 AM Michael Dresser ***@***.***> wrote:
It seems like kubectl cost assets could be a super set of this command,
plus LBs, disks, etc. Just an idea..
The trouble with this is that each asset type has different fields. We
could certainly do kubectl cost assets and have it show only total cost
and asset type, but I don't think we can do much more than that.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACI25YXL4AZOZHAC7EAA63TSDIEVANCNFSM46NDMEEA>
.
|
In regards to the first point, the monthly cost is by default. This is in line with the other |
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.
Great work so far. I'd also like to see an update to the README ("Usage", see the list of subcommands) and the usage section with an example of kubectl cost node
pkg/query/assetsapi.go
Outdated
// aggregate, accumulate, and disableAdjustments are hardcoded; | ||
// as other asset types are added in to be filtered by, this may change, | ||
// but for now anything beyond isn't needed. | ||
|
||
requestParams := map[string]string{ | ||
"window": p.Window, | ||
"aggregate": "", | ||
"accumulate": "true", | ||
"disableAdjustments": "true", | ||
"filterTypes": p.FilterTypes, | ||
} |
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.
If they're hardcoded, don't provide them as options in the struct.
pkg/query/assetsapi.go
Outdated
"aggregate": "", | ||
"accumulate": "true", | ||
"disableAdjustments": "false", |
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.
For aggregate
, accumulate
, and disableAdjustments
, either use the value from the parameter struct or remove the option from the parameter struct entirely. I would recommend removing these from the parameter struct entirely as I don't think we have a use case yet for configuring these and I don't anticipate one soon.
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.
Great! I'd just ask that you update this list of subcommands:
Line 53 in cfc068e
There are several supported subcommands: `namespace`, `deployment`, `controller`, `label`, `pod`, and `tui`, which display cost information aggregated by the name of the subcommand (see Examples). Each subcommand has two primary modes, rate and non-rate. Rate (the default) displays the projected monthly cost based on the activity during the window. Non-rate (`--historical`) displays the total cost for the duration of the window. |
@michaelmdresser can this make its way into a release? Looking forward to using it :) |
Hi @tsunamishaun. With the latest release, the |
Awesome, @kaelanspatel! Do we have plan to support an |
@dwbrown2 Yes, that's definitely something we should do. I think the plan was to either eventually have an |
Ref #78.
Adds node subcommand which generates a cost table filtered by individual nodes. Also implements
QueryAssets
andwriteAssetTable
which can be modified to be used for other asset types in the future.Sample output: