72813baf8d47
Get Cluster Aggregated Detailed Costs
Provides Kubernetes cluster resource usage and costs over a time interval which can be grouped and/or filtered by label/annotaion.
For example - application name (webapp, backend), environment (production, staging), version etc.
The response will contain a breakdown of the cluster resource costs($) in terms of compute (CPU, memory), storage (block, file, rootVolume).
The response will group the cluster usage costs based on preselected default of application namespace or user selected label or annotation.
Within the group, resource costs are broken down per resource kind (Deployment, DaemonSet etc.).
Time Rounding Down: The CostAnalysis API applies rounding down to the hours provided during the call.
For example, the value 1707004799099 (In GMT) representing Saturday, February 3, 2024, 23:59:59.099 is rounded down to Saturday, February 3, 2024, 23:00:00.000, resulting in the omission of one hour of cost.
Parameters
Request body
Example request
{
"startTime": "2018-06-20T11:35:02.745Z",
"endTime": "2018-06-22T11:30:01.745Z",
"groupBy": "namespace.label.env",
"filter": {
"conditions": {
"anyMatch": [
{
"allMatch": [
{
"type": "label",
"key": "env",
"operator": "equals",
"value": "prod"
},
{
"type": "label",
"key": "app",
"operator": "exists"
}
]
},
{
"allMatch": [
{
"type": "annotation",
"key": "meta.data",
"operator": "exists"
}
]
}
]
}
}
}