Skip to content

Commit ffc4c85

Browse files
authored
Clarify how idle is calculated and why it doesn't show adjustments (#1188)
1 parent f51b05b commit ffc4c85

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

apis/monitoring-apis/api-allocation.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Querying for `window=3d` should return a range of four sets because the queried
250250

251251
## Special types of allocation
252252

253-
* `__idle__` refers to resources on a cluster that were not dedicated to a Kubernetes object (e.g. unused CPU core-hours on a node). An idle resource can be shared (proportionally or evenly) with the other allocations from the same cluster. (See the argument `shareIdle`.)
253+
* `__idle__` refers to resources on a cluster that were not dedicated to a Kubernetes object (e.g. unused CPU core-hours on a node). An idle resource can be shared (proportionally or evenly) with the other allocations from the same cluster. (See the argument `shareIdle`). If using `reconcile=true` the `__idle__` line item will not show any costAdjustments. This is normal, because idle is computed _after_ the cost of the node is adjusted and the cost of the node's container workloads are adjusted. For more information, reference the documentation on [Efficiency and Idle](/using-kubecost/navigating-the-kubecost-ui/cost-allocation/efficiency-idle.md)
254254
* `__unallocated__` refers to aggregated allocations without the selected `aggregate` field; e.g. aggregating by `label:app` might produce an `__unallocated__` allocation composed of allocations without the `app` label.
255255
* `__unmounted__` (or "Unmounted PVs") refers to the resources used by PersistentVolumes that aren't mounted to a pod using a PVC, and thus cannot be allocated to a pod.
256256

@@ -746,9 +746,3 @@ Here, we provide theoretical error bounds for different resolution values given
746746
* \-1.00, 10.00 means that the result could be as high as 1000% error (e.g. 30s pod being counted for 5m) or the pod could be missed altogether, i.e. -100% error.
747747

748748
<table><thead><tr><th width="129" align="right">resolution</th><th align="center">30s pod</th><th align="center">5m pod</th><th align="center">1h pod</th><th align="center">1d pod</th><th align="center">7d pod</th></tr></thead><tbody><tr><td align="right">1m</td><td align="center">-1.00, 2.00</td><td align="center">0.80, 1.00</td><td align="center">0.98, 1.00</td><td align="center">1.00, 1.00</td><td align="center">1.00, 1.00</td></tr><tr><td align="right">2m</td><td align="center">-1.00, 4.00</td><td align="center">0.80, 1.20</td><td align="center">0.97, 1.00</td><td align="center">1.00, 1.00</td><td align="center">1.00, 1.00</td></tr><tr><td align="right">5m</td><td align="center">-1.00, 10.00</td><td align="center">-1.00, 1.00</td><td align="center">0.92, 1.00</td><td align="center">1.00, 1.00</td><td align="center">1.00, 1.00</td></tr><tr><td align="right">10m</td><td align="center">-1.00, 20.00</td><td align="center">-1.00, 2.00</td><td align="center">0.83, 1.00</td><td align="center">0.99, 1.00</td><td align="center">1.00, 1.00</td></tr><tr><td align="right">30m</td><td align="center">-1.00, 60.00</td><td align="center">-1.00, 6.00</td><td align="center">0.50, 1.00</td><td align="center">0.98, 1.00</td><td align="center">1.00, 1.00</td></tr><tr><td align="right">60m</td><td align="center">-1.00, 120.00</td><td align="center">-1.00, 12.00</td><td align="center">-1.00, 1.00</td><td align="center">0.96, 1.00</td><td align="center">0.99, 1.00</td></tr></tbody></table>
749-
750-
## Troubleshooting
751-
752-
### Incomplete cost data for short window queries when using Thanos
753-
754-
While using Thanos, data can delayed from 1 to 3 hours, which may result in allocation queries retrieving inaccurate or incomplete data when using short `window` intervals. Avoid using values for `window` smaller than `5h` as a best practice.

using-kubecost/navigating-the-kubecost-ui/cost-allocation/efficiency-idle.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Node idle cost can be expressed as:
3434
3535
So, idle costs can also be thought of as the cost of the space that the Kubernetes scheduler could schedule pods, without disrupting any existing workloads, but it is not currently.
3636

37+
Kubecost continuously recalculates idle costs whenever underlying Assets & Allocations data changes. For example when cloud billing integration is enabled and Kubecost reconciles with your cloud bill, the process follows a specific sequence: first node costs are adjusted, then container workload costs on those nodes are updated, and finally idle costs are fully recalculated. As a result, when querying the Allocations API, the `__idle__` line item will not show any "adjustments" entries.
38+
3739
### Sharing idle
3840

3941
Idle can be charged back to pods on a cost-weighted basis or viewed as a separate line item. As an example, consider the following representations:

0 commit comments

Comments
 (0)