Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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.
window*
string
Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See the 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 ) 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
.
GET
http://app.kubecost.com/query/assets/query
The Assets API retrieves backing cost data broken down by individual assets in your cluster but also provides various aggregations of this data.
window*
string
format
string
File type when exporting query. Currently only supports json
.
aggregate
string
Used to consolidate cost model data. Supported values are account
, category
, cluster
, name
, project
, providerid
, provider
, service
, type
, department
, environment
, owner
, product
, team
, and label:<name>
. Passing an empty value for this parameter or none at all returns data by an individual asset. Supports multi-aggregation (aggregation of multiple categories) in a comma separated list, such as aggregate=account,project
.
accumulate
boolean
If true
, sum the entire range of time intervals into a single set. Default value is false
.
limit
int
Refers to the number of line items per page. Currently, only supported together with accumulate=true
to obtain a single list of line items.
filter
string
GET
http://app.kubecost.com/query/assets/totals
The /totals
endpoint does not aggregate, and accepts only a window and an optional filter, returning a single total cost.
window*
string
format
string
File type when exporting query. Currently only supports json
.
filter
string
Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See this section on for more information.
Filter your results by any category which you can aggregate by, can support multiple filterable items in the same category in a comma-separated list. For example, to filter results by clusters A and B, use filter=cluster:clusterA,clusterB
See our doc for a complete explanation of how to use filters and what categories are supported.
Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See this section on for more information.
Filter your results by any category which you can aggregate by, can support multiple filterable items in the same category in a comma-separated list. For example, to filter results by clusters A and B, use filter=cluster:clusterA,clusterB
See our doc for a complete explanation of how to use filters and what categories are supported.
GET
http://app.kubecost.com/query/allocation/query
The Allocation API is the preferred way to query for costs and resources allocated to Kubernetes workloads and optionally aggregated by Kubernetes concepts like namespace
, controller
, and label
.
window*
string
format
string
File type when exporting query. Currently only supports json
.
aggregate
string
Field by which to aggregate the results. Accepts: cluster
, node
, container
, controller
, controllerKind
, namespace
, pod
, providerId
, service
, label:<name>
, annotation:<name>
, deployment
, daemonset
, statefulset
, job
, department
, environment
, owner
, or product
. Also accepts comma-separated lists for multi-aggregation, like namespace,label:app
.
accumulate
boolean
If true
, sum the entire range of time intervals into a single set. Default value is false
. Does not accumulate idle costs, which must be configured separately.
idle
boolean
If true
, include idle cost (i.e. the cost of the un-allocated assets) as its own allocation. Default is true.
idleByNode
boolean
If true
, idle allocations are created on a per node basis. Otherwise, idle allocations are created on a per cluster basis.
limit
int
Refers to the number of line items per page. Currently, only supported together with accumulate=true
to obtain a single list of line items.
filter
string
GET
http://app.kubecost.com/query/allocation/totals
The Allocation API is the preferred way to query for costs and resources allocated to Kubernetes workloads. The /totals
endpoint does not aggregate, and accepts only a window and an optional filter, returning a single total cost.
window*
string
format
string
File type when exporting query. Currently only supports json
.
filter
string
Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See this section on for more information.
Filter your results by any category which you can aggregate by, can support multiple filterable items in the same category in a comma-separated list. For example, to filter results by clusters A and B, use filter=cluster:clusterA,clusterB
See our doc for a complete explanation of how to use filters and what categories are supported.
Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See this section on for more information.
Filter your results by any category which you can aggregate by, can support multiple filterable items in the same category in a comma-separated list. For example, to filter results by clusters A and B, use filter=cluster:clusterA,clusterB
See our doc for a complete explanation of how to use filters and what categories are supported.
GET
http://app.kubecost.com/query/cloudcost/query
The Cloud Cost API is the preferred way to query for costs and resources related to cloud provider services.
window*
string
format
string
File type when exporting query. Currently only supports json
.
aggregate
string
Used to consolidate cost model data. Supported values are invoiceEntityID
, accountID
, provider
, providerID
, category
, and service
, as well as label:<name>
. Passing an empty value for this parameter or none at all returns data by an individual cloud cost. Supports multi-aggregation (aggregation of multiple categories) in a comma separated list, such as aggregate=provider,service
.
accumulate
boolean
If true
, sum the entire range of time intervals into a single set. Default value is false
.
costMetric
String
Determines which cloud cost metric type will be returned. Acceptable values are amortizedNetCost
, amortizedCost
, invoicedCost
, listCost
, and netCost
. Default is amortizedNetCost
.
limit
int
Refers to the number of line items per page. Currently, only supported together with accumulate=true
to obtain a single list of line items.
filter
string
GET
http://app.kubecost.com/query/cloudcost/totals
The /totals
endpoint does not aggregate, and accepts only a window and an optional filter, returning a single total cost.
window*
string
format
string
File type when exporting query. Currently only supports json
.
filter
string
Kubecost's Cluster Right-Sizing Recommendation API can monitor the resource utilization of your clusters and offer cost-effective right-sizing solutions.
GET
http://app.kubecost.com/query/savings/clusterSizingETL
window
string
Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See this section on for more information.
targetUtilization
float in the range (0, 1]
Target CPU/RAM utilization which parallels environment profiles. For reference, Development should equal .80
, Production should equal .65
, and High Availability should equal .5
. Also supports custom values within the range.
minNodeCount
int
Minimum node count to be recommended which parallels environment profiles. For reference, Development should equal 1
, Production should equal 2
, and High Availability should equal 3
. Also supports custom values within the range.
allowSharedCore
boolean
Whether you want to allow shared core node types to be included in your recommendation. Accepts true
or false
.
architecture
string
Accepts x86
or ARM
. Currently, ARM
is only supported on AWS clusters.
spotNodes
boolean
Whether you want to allow Spot node types to be included in your recommendation. Default is false
.
Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See this section on for more information.
Filter your results by any category which you can aggregate by, can support multiple filterable items in the same category in a comma-separated list. For example, to filter results by categories A and B, use filter=category:categoryA,categoryB
See our doc for a complete explanation of how to use filters and what categories are supported.
Duration of time over which to query. Accepts multiple formats including units of time, relative time units, and unix timestamps. See this section on for more information.
Filter your results by any category which you can aggregate by, can support multiple filterable items in the same category in a comma-separated list. For example, to filter results by categories A and B, use filter=category:categoryA,categoryB
See our doc for a complete explanation of how to use filters and what categories are supported.
days
int
Number of historical days over which network traffic should be measured.
threshold
int
The threshold of total traffic (bytes in/out per second) at which a workload is determined abandoned.
Before accessing Kubecost Cloud API endpoints, you must generate an API key value and a personal user token. See our Accessing API Endpoints guide for more information.
The following APIs are available in Kubecost Cloud:
window
parameterThe window
parameter exists for all monitoring APIs as well as select savings APIs which refers to the date range of data for Kubecost to sample. Acceptable formats for using window
parameter include:
Units of time (ex:"15m", "24h", "7d", "48h", etc.)
Relative time references (ex: "today", "yesterday", "week", "month", "lastweek", "lastmonth")
Start and end unix timestamps (ex: "1586822400,1586908800")
Start and end UTC RFC3339 pairs (ex: "2020-04-01T00:00:00Z,2020-04-03T00:00:00Z")