Container Request Right Sizing Recommendation API (V2)
Container Request Right Sizing Recommendation API (V2)
GET
http://<kubecost-address>/model/savings/requestSizingV2
The container request right sizing recommendation API provides recommendations for container resource requests based on configurable parameters and estimates the savings from implementing those recommendations on a per-container, per-controller level. If the cluster-level resources stay static, then there may not be significant savings from applying Kubecost's recommendations until you reduce your cluster resources. Instead, your idle allocation will increase.
Query Parameters
API examples
Querying with /topline
endpoint to view cost totals across query
/topline
endpoint to view cost totals across query/topline
is an optional API endpoint which can be added to your right-sizing query via .../savings/RequestSizingV2/topline...
to provide a condensed overview of all items sampled. TotalMonthlySavings
is the total estimated savings value from adopting right-sizing recommendations. Count
refers to the number of items sampled. Recommendations
should return null
, as it is unable to provide a universal right-sizing recommendation.
Recommendation methodology
The "base" recommendation is calculated from the observed usage of each resource per unique container spec (e.g. a 2-replica, 3-container deployment will have 3 recommendations: one for each container spec).
Say you have a single-container deployment with two replicas: A and B.
A's container had peak usages of 120 mCPU and 300 MiB of RAM.
B's container had peak usages of 800 mCPU and 120 MiB of RAM.
The max algorithm recommendation for the deployment's container will be 800 mCPU and 300 MiB of RAM. Overhead will be added to the base recommendation according to the target utilization parameters as described above.
Applying your request sizing recommendations
After providing you with right sizing recommendations, Kubecost can additionally directly implement these recommendations into your environment. For more information, see the Container Request Recommendation Apply/Plan APIs doc.
Savings projection methodology
See V1 docs.
Last updated