Workload cost allocation
Start with a bill and an owner
FinOps connects engineering decisions to the cost and value of running a service. A Kubernetes cluster can spend money even when its application receives no traffic: provisioned nodes, disks, load balancers and logging may remain billed. Suppose a fictional bookstore pays $12 for a node for one hour, plus $3 in other charges. The objective is to explain every dollar in that window, not to promise a lower bill. Use labels such as team and application, namespace ownership and a stable workload identity; retain an unallocated bucket when ownership is unknown. A label added today cannot reconstruct all historical ownership.
Node $12 + shared platform $2 + direct storage $1 = $15 (hypothetical USD)Split a fixed node bill using resource requests
In this simplified model a node has 4 allocatable CPU cores and 8 GiB allocatable memory. Assign $8 of its hourly cost to CPU and $4 to memory; these invented component weights sum to the fixed node cost. Catalog requests 1 core and 2 GiB; checkout requests 2 cores and 2 GiB. CPU is priced at $2 per core-hour and memory at $0.50 per GiB-hour for this calculation. Catalog gets $3 and checkout $5. The remaining $4 is idle under the request-only model. Real cost models may account for usage above requests, multiple nodes and time-varying prices. A CPU request is a scheduling quantity, not a provider invoice line.
Catalog: 1 × 2 + 2 × 0.50 = $3Checkout: 2 × 2 + 2 × 0.50 = $5Idle: $12 - $3 - $5 = $4Allocate overhead once, without losing the total
Keep the idle cost visible for platform owners or distribute it under a declared rule. In the first policy, split $2 in shared platform cost equally, assign $1 in storage directly to checkout, and retain idle separately. Catalog becomes $4, checkout $7, idle $4. In the second policy, distribute idle in the 3:5 ratio of direct compute allocation before adding shared charges. Catalog becomes $5.50 and checkout $9.50. Both policies reconcile to $15. Do not count the same node twice or hide residuals by forcing every unknown cost onto the largest team. For cents, use a documented rounding rule and preserve the residual. With no nonzero weights, leave the pool unallocated.
Policy A: catalog 4 + checkout 7 + idle 4 = 15Policy B: catalog 5.50 + checkout 9.50 = 15Understand what allocation tools report
OpenCost defines a cost allocation methodology and provides allocation and asset views. The documented Allocation API supports window, aggregate, includeIdle and shareIdle options. A namespace view is useful for ownership review, while an asset view helps reconcile node costs. IBM Kubecost self-hosted 3.x also documents allocation and idle sharing; do not assume identical defaults, paths, or results across releases. The OpenCost release listing includes v1.121.1, a documented candidate, not an installed or verified current deployment. The following is a static query shape only, with no host or real request. Pin the tool and chart, metric sources, cost settings, label handling, time zone and billing integrations before any live comparison.
GET /allocation?window=1h&aggregate=namespace&includeIdle=true&shareIdle=falseReconcile estimates to billing and business value
FOCUS 1.4 distinguishes BilledCost and EffectiveCost; commitment charges and their allocation can make them differ. Choose a cost basis and window consistently, match currency and account scope, map provider resources to workloads, and account for credits, taxes or exclusions without double counting. Keep a reconciliation residual with a reason; late billing exports and missing metrics can change results. Showback reports costs to teams; chargeback assigns them to financial accounts under an approved policy. With $15 total and 3000 successful requests, cost per successful request is $0.005. If zero requests succeed, the metric is undefined, not free. Compare periods with equivalent scope and success definitions.
15 / 3000 = 0.005 USD/success15 / 0 = undefinedInvoice 16 - modeled 15 = 1 USD unresolvedPractice and next step
Use the cost allocation and unit economics cases in lab-fixtures/finops. Predict the idle and shared splits, then run the offline validator. Explain why redistributing costs changes a report but not the node bill. Next: rightsizing and cost trade-offs.
python validate_offline.py # run inside the extracted finops fixture directoryFurther reading
- https://opencost.io/docs/specification/ — Allocation methodology, asset, idle and shared cost
- https://opencost.io/docs/integrations/api/ — Allocation aggregation, time window and idle options
- https://github.com/opencost/opencost/releases — Release listing includes v1.121.1; not asserted latest
- https://www.ibm.com/docs/en/kubecost/self-hosted/3.x?topic=apis-allocation-api — Kubecost self-hosted 3.x allocation API
- https://www.ibm.com/docs/en/kubecost/self-hosted/3.x?topic=dashboard-efficiency-idle — Kubecost 3.x idle and efficiency accounting
- https://framework.finops.org/framework/capabilities/allocation/ — Cost allocation, showback and chargeback
- https://www.finops.org/framework/capabilities/unit-economics/ — Cost measures tied to business units
- https://www.finops.org/framework/capabilities/forecasting/ — Forecast uncertainty and ownership
- https://focus.finops.org/docs/specification/v1-4/columns/cost-and-usage/effective-cost/ — FOCUS 1.4 effective cost
- https://focus.finops.org/docs/specification/v1-4/columns/cost-and-usage/billed-cost — FOCUS 1.4 billed cost
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Workload cost allocation — knowledge check
Allocate shared and idle costs under stated assumptions
What does assigning idle costs to teams change by itself?
A $12 node has direct workload allocations of $3 and $5. What remains idle in the model?
A shared pool has no positive allocation weights. What should happen?
Which distinction matters for a FOCUS-based reconciliation?
What is $15 divided by 3000 successful requests?