Links
Comment on page

Container Request Right Sizing Recommendation API (V2)

get
http://<kubecost-address>/model/
savings/requestSizingV2
Container Request Right Sizing Recommendation API (V2)

API examples

KUBECOST_ADDRESS='http://localhost:9090/model'
curl -G \
-d 'algorithmCPU=quantile' \
-d 'qCPU=0.95' \
-d 'algorithmRAM=max' \
-d 'targetCPUUtilization=0.8' \
-d 'targetRAMUtilization=0.8' \
-d 'window=3d' \
--data-urlencode 'filter=namespace:"kubecost"+container:"cost-model"' \
${KUBECOST_ADDRESS}/savings/requestSizingV2

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.
©2023 Stackwatch, Inc. All rights reserved. Designed & built in California.