Closed michaelmdresser closed 3 years ago
Each allocation comes with a mintues
field, so it should be possible to scale to monthly rate based on active time or window time. (There are still caveats, like CronJob
-based allocations, allocated by controller and accumulated over a long window, where the mintues
field will count as the time between the start of the first run and the end of the last run.)
Resolved by #93
Kubectl cost uses the Aggregated cost model API for monthly rate queries, i.e. non
--historical
queries. That API is old and we want to switch everything to use the Allocation API whichkubectl cost
already uses for--historical
queries.We should be able to cut out
/aggregatedCostModel
queries by hitting/allocation
and then transforming the cost numbers to a monthly rate based on the coverage of the resulting data. Special care will have to be taken due to the time-based quirks of the Allocation API. Instead of doing something likecost * (month / query window)
we should docost * (month / duration of resulting data coverage)
.