Allocation API

Allocation API (Querying)

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.

Path Parameters

Name
Type
Description

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

Allocation API (Total)

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.

Path Parameters

Name
Type
Description

window*

string

format

string

File type when exporting query. Currently only supports json.

filter

string

Last updated