Multi-Cloud Cost Optimization

Last scan: 2026-10-31T05:28:30Z
Cost Overview Optimization Anomalies Governance Tagging FinOpsForAI Container Cost Optimization Recommendations Remediation Architecture FinOps Agent

Container Cost Optimization

A vendor-neutral methodology for measuring and allocating infrastructure and container costs in Kubernetes environments, based on the OpenCost Specification. Kubernetes runs transient, containerized workloads that consume variable amounts of shared cluster resources. This tab specifies how to accurately measure and allocate the cost of a cluster to the tenants that consume it.

a) Total Cluster Costs — Calculation Details

Total Cluster Costs represent all costs required to operate a Kubernetes cluster. They break down into Cluster Asset Costs (directly observable entities: nodes, persistent volumes, attached disks, load balancers, and network ingress/egress) and Cluster Overhead Costs (the overhead to operate all assets, e.g. cluster management fees). From a financial-accounting view, Asset Costs are equivalent to Cost of Goods Sold, while Overhead Costs are equivalent to SG&A (indirect costs).

Definition 1 — Assets + Overhead
Total Cluster Costs = Cluster Asset Costs + Cluster Overhead Costs
Definition 2 — Expanded by Allocation / Usage / Overhead
Total Cluster Costs = Resource Allocation Costs (for all assets)
                    + Resource Usage Costs      (for all assets)
                    + Cluster Overhead Costs    (for cluster)
Definition 3 — Distributed to tenants (Workload + Idle + Overhead)
Total Cluster Costs = Workload Costs + Cluster Idle Costs + Cluster Overhead Costs

Once calculated, Asset Costs are distributed to the tenants that consume them, where Workload Costs + Idle Costs = Asset Costs. Workload costs are directly attributable to a set of Kubernetes workloads (container, pod, deployment, etc.); Cluster Idle Costs are the portion of Resource Allocation Costs not allocated to any workload.

Total Cluster Cost Composition (Assets + Overhead)

Cost Distribution to Tenants (Workload + Idle + Overhead)

Cost Waterfall — From Total Cluster Cost to Allocated Workload Cost

b) Cluster Asset Costs — In Detail

Cluster Assets are observable entities within a cluster that directly incur costs. Asset Costs consist of Resource Allocation Costs (accumulate based on time provisioned, irrespective of usage — e.g. CPU hourly rate) and Resource Usage Costs (accumulate per unit consumed — e.g. cost per byte egressed). An individual asset's cost is the sum of its components, e.g. a Node's cost = CPU cost + GPU cost + RAM cost + Node Network cost. Every conforming asset MUST include at least one cost component with Amount, Unit, and Rate attributes and a TotalCost value.

Resource Allocation Costs

Amount × Duration × HourlyRate

Attributes: Amount (e.g. 2 CPU cores), Duration (hrs), Unit (CPU cores), HourlyRate ($/unit-hr), TotalCost.

Resource Usage Costs

Amount × UnitRate

Attributes: Amount (e.g. 1GB egress), Unit (GB), UnitRate ($/unit), TotalCost.

Asset Cost Inputs by Type (example billing models over a 24-hour window)

AssetCost TypeFormula / Inputs
Node — CPUAllocation total = cores × duration × price   cores = avg_over_time(cpu) by (node); duration = end−start [hrs]; price [$/core-hr]
Node — RAMAllocation total = ram_bytes × duration × price   ram = avg_over_time(GB) by (node); price [$/GB-hr]
Persistent VolumesAllocation DiskSize = avg_over_time(GB) by (pv); price [$/GB-hr] — function of disk class, IOPS, backup size
Attached DisksAllocation DiskSize = avg_over_time(GB) by (pv); price [$/GB-hr] — ephemeral storage used per pod on node
Load Balancer — UsageUsage amount = bytes ingressed; price = $ per byte ingressed
Load Balancer — AllocationAllocation rules = # of forwarding rules defined; price = average $ per forwarding rule

Resource Measurement Reference

Resource TypeMeasurement
CPUThe greater of requested and used CPU resources measured in cores or millicores.
MemoryThe greater of requested resources and memory in use measured in bytes or gigabytes.
GPUThe greater of requested resources and used resources measured in cores.
Storage VolumeThe storage capacity of Persistent Volume Claim (PVC) requests measured in bytes or gigabytes. Attached at the Kubernetes pod level.
NetworkAmount of ingress or egress across zones, regions, or the wide internet measured in bytes or gigabytes (can vary by provider).
Load BalancerThe number of load balancers used plus the volume of connections and bytes (can vary by provider).

Overhead Costs

Cluster Management Fees

Provider fees typically charged on an hourly basis.

Operator Fees

Potential DevOps team costs allocated to cluster operations.

c) Workload Costs — In Detail

Workloads are entities to which Asset Costs are committed. Some resources have only Usage Costs; others carry Allocation Costs independent of actual usage. When assets have Resource Allocation Costs (e.g. CPU or GPU), Workload Costs are understood as max(request, usage) — this assigns costs directly reserved or allocated by kube-scheduler. Workload Costs should be calculated at the lowest level possible (the container level) and then aggregated by any dimension.

Workload Cost formula (per resource with allocation cost)
Workload Cost = max(request, usage)   [computed at container level, then aggregated]

Supported Workload Cost Aggregations

container
pod
deployment
statefulset
job
controller name
controller kind
label
annotation
namespace
cluster

d) Shared Costs — In Detail

Shared Workload Costs, Cluster Idle Costs, and Overhead Costs are common costs that organizations can optionally distribute amongst tenants. A common example is system workload costs (e.g. kube-system pods) that benefit all tenants. A full implementation should support various methods of distributing shared costs.

Common Distribution Methods

MethodDescription
UniformlyDistributed evenly across all other tenants.
ProportionalProportionate to a tenant's consumption of Cluster Asset costs.
Custom MetricBased on a custom metric, e.g. bytes of network egress.

e) Idle Costs — In Detail

Idle Costs can be calculated at both the Asset/Resource level and the Workload level. Asset Idle Costs represent the cost-weighted difference between Cluster Asset Costs and the costs of resources actually allocated or consumed. Workload Idle Costs are a cost-weighted measurement of requested resources that go unused, and can be computed on any grouping of workloads (containers, pods, labels, annotations, namespaces, etc.).

Cluster Idle Cost
Cluster Idle Cost = ( Cluster Asset Costs - Workload Costs )
Cluster Idle Percentage
Cluster Idle % = Idle Cost / Resource Allocation Costs

Asset Idle Cost can be calculated by individual assets, groups of assets, cluster(s), and by individual resources (e.g. CPU). Resources strictly billed on usage can be viewed as 100% efficient and should not be included when measuring the idle percentage of a cluster (a usage-billed resource never "sits idle").

Asset Cost: Allocated vs Idle

Idle % by Resource (illustrative)

f) Pod States

The state of a pod affects the ability to assign costs and whether a resource is considered allocated. The OpenCost model does not account for resources allocated to pods in ImagePullBackOff.

StateCost AllocationStatus
Running Max(Usage, request) Implemented
ImagePullBackOff Request Currently no charge