Request Right-Sizing Recommendation API

Container Request Right Sizing Recommendation API

GET app.kubecost.com/query/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

Name
Type
Description

window*

string

Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See the API Directory for more a more detailed explanation of valid inputs to window. Hourly windows are not currently supported. It's recommended to provide a window greater than 2d.

algorithmCPU

string

The algorithm to be used to calculate CPU recommendations based on historical CPU usage data. Options are max and quantile. Max recommendations are based on the maximum-observed usage in window. Quantile recommendations are based on a quantile of observed usage in window (requires the qCPU parameter to set the desired quantile). Defaults to max.

algorithmRAM

string

Like algorithmCPU, but for RAM recommendations.

targetCPUUtilization

float in the range (0, 1]

A ratio of headroom on the base recommended CPU request. If the base recommendation is 100 mCPU and this parameter is 0.8, the recommended CPU request will be 100 / 0.8 = 125 mCPU. Defaults to 0.7. Inputs that fail to parse (see Go docs here) will default to 0.7.

targetRAMUtilization

float in the range (0, 1]

Calculated like targetCPUUtilization.

qCPU

float in the range (0, 1]

The desired quantile to base CPU recommendations on. Only used if algorithmCPU=quantile. Note: a quantile of 0.95 is the same as a 95th percentile.

qRAM

float in the range (0, 1]

Like qCPU, but for RAM recommendations.

page

int

Establishes starting page of results where 0 is the first page, 1 is the second, etc. Default is 0.

itemsPerPage

int

Establishes number of items per page. Default is 0.

filter

string

A filter to reduce the set of workloads for which recommendations will be calculated.

sortBy

string

Column to sort the response by. Defaults to totalSavings. Options are totalSavings, currentEfficiency, cpuRecommended, cpuLatest, memoryRecommended, and memoryLatest.

sortByOrder

string

Order to sort by. Defaults to descending. Options are descending and ascending.

includeLabelsAndAnnotations

boolean

Displays all labels and annotations associated with each container request when set to true. Default is false.

Last updated