FinOps for Kubernetes: how to reduce Kubernetes and cloud costs with the telemetry you already collect

Cost allocation with requests, usage and idle cost, rightsizing from real utilisation, finding waste, unit economics from traces and metrics, OpenCost, FOCUS, cost anomaly alerts and a 30-day plan.

Obseria TeamObseria
Summary
  • Kubernetes makes cloud bills harder to read, because many workloads share the same nodes. Allocate cost from requests and real usage per namespace and label, and make idle and shared cost visible instead of hiding it.
  • Most savings come from engineering decisions that telemetry can justify: rightsizing requests against p95 usage, better bin packing, sensible node pools, careful use of spot capacity and switching off what nobody uses.
  • Open standards help: OpenCost turns cluster usage into cost data, FOCUS normalises billing exports across providers, and joining both with traces and metrics gives you cost per request, per customer or per transaction.

FinOps for Kubernetes is the practice of making cluster and cloud spend visible, attributable and steerable, so that engineers can make cost a design input in the same way they treat latency or availability. The raw material is mostly data you already have: resource requests from the Kubernetes API, CPU and memory usage from cAdvisor and the kubelet, request volumes from traces and metrics, and the billing export from your cloud provider. What is usually missing is the connection between them.

This guide shows how to build that connection. It covers why cloud bills are hard to attribute, the FinOps Foundation framework in brief, cost allocation in Kubernetes, rightsizing from real utilisation, typical sources of waste, unit economics, the open projects OpenCost and FOCUS, the cost of observability itself, cost anomaly alerts, a 30-day plan and a checklist. If you mainly want to lower your telemetry bill, read our article on cutting observability costs with a pipeline-first approach first; this post looks at the bigger picture of Kubernetes and cloud spend.

Why cloud bills are hard to attribute

A cloud invoice is organised around what the provider sells: accounts, services, SKUs, regions and usage types. Engineering teams think in products, services, namespaces and deployments. The gap between these two views is the main reason why many organisations know what they spend in total but not who or what causes it.

  • Shared infrastructure. A Kubernetes node is billed as one virtual machine, yet it runs pods from several teams. The bill cannot tell you how to split it.
  • Inconsistent tagging. Tags and labels are applied by hand or by templates that drift. Resources created in a hurry during an incident often carry no owner at all.
  • Indirect cost. Network egress, NAT gateways, load balancers, snapshots and cross-zone traffic show up as separate line items that are hard to map back to a service.
  • Discounts and commitments. Savings plans, reserved capacity and negotiated rates change the effective price, which means list price and what you actually pay can diverge.
  • Timing. Billing data typically arrives with a delay of hours to a day, while a misconfigured autoscaler can create cost within minutes.

Telemetry fills exactly these gaps: it knows which pod ran on which node, how much it used, which service it belongs to and how much traffic it served.

The FinOps framework in brief: Inform, Optimize, Operate

The FinOps Foundation, part of the Linux Foundation, describes FinOps as an operating model in which engineering, finance and business share responsibility for cloud spend. Its framework organises the work in three iterative phases:

PhaseGoalTypical work in Kubernetes
InformVisibility and allocationCost per namespace, team and service; showback reports; ownership labels
OptimizeUse resources and rates efficientlyRightsizing requests, bin packing, node pool design, commitments, spot capacity
OperateMake it continuousBudgets, cost anomaly alerts, policies in CI, regular reviews with service owners

The phases are a loop, not a project plan. Teams usually start with Inform, because optimisation without reliable allocation tends to produce arguments rather than savings.

Cost allocation in Kubernetes

Allocating cluster cost means distributing the cost of nodes, storage and networking to the workloads that use them. Four concepts matter.

Requests versus usage

The scheduler reserves capacity based on resources.requests, not on what a container actually uses. A pod that requests four cores but uses half a core still blocks four cores on the node. Allocating only by usage therefore rewards overprovisioning, and allocating only by requests ignores bursts above the request. A common approach, used by OpenCost among others, is to allocate each container the higher of its request and its usage for each time interval.

Namespaces and labels

Namespaces are the simplest allocation unit, but they rarely map one to one to teams or products. Define a small set of mandatory labels, for example team, service, env and cost-center, enforce them with an admission policy, and use the same keys as resource tags in your cloud account. Consistent keys across Kubernetes labels, cloud tags and OpenTelemetry resource attributes such as service.name and deployment.environment.name are what makes later joins possible.

Shared cost

Some workloads serve everyone: ingress controllers, service meshes, DNS, monitoring agents, the control plane. Decide explicitly how to treat them. Common options are to split them proportionally to each team's allocated cost, to split them evenly, or to report them as a separate platform line. The choice matters less than making it visible and keeping it stable over time.

Idle cost

Idle cost is node capacity that no pod has requested. It arises from headroom for autoscaling, fragmentation, oversized nodes and nodes kept alive by a single small pod. Report it as its own line item rather than silently distributing it, because idle cost is often the clearest signal that bin packing or node sizes need attention.

Allocation itemData sourceRecommended treatment
Workload costRequests, usage, node pricemax(request, usage) per interval, per namespace and label
Persistent volumesPVC size, storage class priceAssign to the namespace that owns the claim
Shared servicesSystem namespacesProportional split or separate platform line
Idle capacityNode allocatable minus requestsSeparate line, owned by the platform team
Out-of-cluster servicesBilling export with tagsMap via tags to the same team and service keys

Rightsizing from real utilisation

Rightsizing means setting requests and limits so that they reflect what a workload actually needs, with a deliberate safety margin. The input is utilisation over a representative period, typically including at least one full weekly cycle and, if relevant, a month-end or release peak.

Compare requests with p95 usage

Average usage hides peaks, and maximum usage is dominated by one-off spikes. A high percentile such as p95 or p99 of usage over several days is a better baseline for CPU. For memory, look at the maximum working set, because exceeding a memory limit ends with an OOM kill rather than slower responses. The following PromQL query, based on kube-state-metrics and cAdvisor metrics, shows the ratio of p95 CPU usage to CPU requests per namespace:

# Example: p95 CPU usage over 7 days divided by CPU requests, per namespace
sum by (namespace) (
  quantile_over_time(0.95,
    sum by (namespace, pod, container) (
      rate(container_cpu_usage_seconds_total{container!="", container!="POD"}[5m])
    )[7d:5m]
  )
)
/
sum by (namespace) (
  kube_pod_container_resource_requests{resource="cpu", unit="core"}
)

A value far below 1 means the namespace reserves much more CPU than it uses at the 95th percentile. Summing per-container percentiles overestimates the namespace peak slightly, which is acceptable for a first view. For memory, replace the numerator with max_over_time(container_memory_working_set_bytes{container!=""}[7d]) and the denominator with resource="memory". Depending on your setup, you may want to restrict requests to running pods by joining with kube_pod_status_phase{phase="Running"}.

Practical rules for changing requests

  • Change in small steps and watch latency, error rate and CPU throttling after each step. Rightsizing that breaks an SLO is not a saving.
  • Keep CPU limits under review. Tight CPU limits cause throttling even when the node has spare capacity; many teams set CPU requests carefully and use limits sparingly. Memory limits are a different matter, because memory cannot be throttled.
  • Use the Vertical Pod Autoscaler in recommendation mode first (updateMode: "Off") to get suggested requests without automatic restarts, then decide per workload whether to apply them automatically.
  • Do not let VPA and HPA act on the same metric. The Kubernetes documentation advises against combining both on CPU or memory for the same workload. A common pattern is HPA on CPU or on a custom metric such as requests per second, with requests tuned from VPA recommendations.
  • Scale on demand, not on schedule alone. Autoscaling based on real load lets you run fewer replicas at night without manual intervention.

Bin packing and node pools

Rightsized pods only save money if the cluster actually removes the freed capacity. That depends on how well pods fit onto nodes. Check how much allocatable CPU and memory remains unrequested per node, separate workloads with very different shapes (memory-heavy databases, CPU-heavy batch jobs) into dedicated node pools, and let the cluster autoscaler or a provisioner such as Karpenter consolidate underused nodes. Pod disruption budgets and topology spread constraints keep consolidation from hurting availability.

Spot and preemptible capacity, with care

Spot or preemptible instances are offered at a discount but can be reclaimed by the provider at short notice. They suit stateless, horizontally scaled services, CI runners and batch jobs that can be retried. Keep stateful systems, single-replica services and anything with long startup times on regular capacity, spread spot nodes across several instance types and zones, and handle the termination notice with graceful shutdown. Telemetry tells you whether interruptions affect users: watch error rates and latency around node terminations.

Finding waste

Waste is cost without value. It is rarely dramatic in a single resource, but it accumulates. These are the usual places to look, together with the signal that reveals them.

Type of wasteSignalTypical action
Orphaned volumes and snapshotsDisks not attached to any instance, PVs in Released state, old snapshotsReview owner, snapshot if needed, delete
Idle load balancersLoad balancers without healthy targets or with near-zero trafficRemove the Service of type LoadBalancer or consolidate behind one ingress
Overprovisioned databasesLow CPU and connection usage on managed instances over weeksSmaller instance class, storage autoscaling, read replica review
Zombie workloadsDeployments with no inbound requests, no spans and no log activityConfirm with the owner, scale to zero, delete
Dev and test running 24/7Non-production namespaces with steady cost outside working hoursScheduled scale-down, ephemeral preview environments
Forgotten experimentsResources without owner tags, created by individual usersMandatory tags, expiry labels, regular cleanup

Zombie workloads are where observability shines: a deployment that has received no request in its traces for weeks and emits only health check logs is a strong candidate for removal. Our Kubernetes observability checklist describes the baseline telemetry you need to make such judgements with confidence.

Unit economics: cost per request, customer or transaction

Total spend going up is not necessarily bad, as long as the business grows faster. Unit economics relate cost to a unit of value, for example cost per thousand API requests, per active customer, per order or per processed document. This turns a cost discussion into an efficiency discussion.

The calculation is simple once allocation is in place: divide the allocated cost of a service in a period by the number of units it served in that period. The units come from telemetry. Request counts come from trace or HTTP metrics, transactions from business events, and customers from a tenant attribute on spans.

Illustrative calculation with example values, not benchmarks: a checkout service is allocated 3,000 EUR in a month and processes 600,000 orders. Its cost per order is 0.005 EUR. If a release doubles the CPU request per pod while order volume stays flat, cost per order rises accordingly, and the change is visible within days instead of at the next invoice.

  • Per request: join allocated cost per service with request rate from span metrics or ingress metrics.
  • Per customer: add a tenant identifier as a span attribute and attribute shared service cost proportionally to each tenant's share of requests or compute time. Watch the cardinality of such attributes.
  • Per transaction: count business events such as orders or invoices and relate them to the cost of the services on the critical path.

Start with one or two units that leadership already cares about, rather than trying to model every product.

OpenCost: open-source Kubernetes cost data

OpenCost is an open-source project of the Cloud Native Computing Foundation (CNCF) that measures and allocates Kubernetes cost. It combines resource requests and usage from the cluster with pricing data, either from cloud provider pricing APIs or from custom price sheets for on-premises clusters, and calculates cost per container, pod, namespace, controller and label. It also reports idle cost.

For an observability setup, two properties are useful. First, OpenCost exposes its results as Prometheus metrics, which means cost can be scraped, stored and queried next to CPU, latency and error rates. Second, it provides an API for allocation queries over time windows, which you can use for showback reports. Treat OpenCost figures as an engineering view: for reconciliation with finance, compare them regularly with the billing export, which includes discounts and charges that cluster-level estimates may not reflect.

FOCUS: a common format for billing data

The FinOps Open Cost and Usage Specification (FOCUS) is an open specification maintained under the FinOps Foundation. It defines a common schema for cost and usage data, so that billing exports from different cloud and SaaS providers can be analysed together. Version 1.0 was published in 2024, and the major cloud providers offer exports aligned with the specification.

FOCUS defines columns such as BilledCost, EffectiveCost, ListCost, ChargeCategory, ServiceName, ResourceId, RegionId, SubAccountId and Tags. For observability, the important ones are ResourceId and Tags, because they are your join keys to telemetry. If your tag keys match your Kubernetes labels and OpenTelemetry resource attributes, a single query can answer which service caused a cost increase and what happened to its traffic at the same time.

Check the current version of the specification and your provider's documentation before you build on specific columns, since both evolve.

The cost of observability itself

Telemetry is not free, and in many organisations it becomes one of the larger line items. The main drivers are well understood:

  • Log volume: debug logs left on in production, verbose health checks, duplicated logs from sidecars and agents.
  • Metric cardinality: labels with user IDs, request paths with IDs, pod names on long-lived series. Our article on the hidden cost of high-cardinality labels covers this in detail.
  • Retention: keeping everything at full resolution for as long as the longest compliance requirement.
  • Trace volume: storing every span of every successful request instead of sampling sensibly.

The most effective lever is to decide what to keep before it is stored. A telemetry pipeline can drop noisy logs, aggregate high-volume events into metrics, remove or hash high-cardinality attributes, mask personal data, apply tail-based sampling that keeps errors and slow traces, and route data to storage tiers with different retention. Apply the same FinOps discipline to observability that you apply to the rest of the cloud: allocate telemetry volume per team and service, and make it visible to the people who produce it.

Alerting on cost anomalies

Budgets tell you at the end of the month that something went wrong. Cost anomaly alerts tell you on the same day. Because billing data arrives late, combine two kinds of signals: fast proxies from telemetry, such as requested cores or node count, and slower confirmed cost from the billing export.

The following rules are examples. Thresholds depend on your environment and should be tuned against your own history.

Example ruleSignalExample condition
Requested CPU jumpskube_pod_container_resource_requests per namespaceMore than 30 percent above the same hour last week for 1 hour
Node count grows without trafficNode count versus request rateNodes up, requests flat, for 2 hours
Daily cost deviationDaily cost per service from billing or OpenCostAbove the 30-day baseline by a defined margin
Unit cost regressionCost per 1,000 requests per serviceRising for 3 consecutive days after a deployment
Telemetry volume spikeIngested log bytes or active series per serviceDoubling compared with the previous day

A simple PromQL example for the first rule:

# Example: requested CPU per namespace is 30% above the same time last week
sum by (namespace) (kube_pod_container_resource_requests{resource="cpu"})
  > 1.3 *
sum by (namespace) (kube_pod_container_resource_requests{resource="cpu"} offset 7d)

Route cost alerts to the owning team, not to on-call, unless the cost increase is a symptom of an incident such as a crash loop or runaway autoscaling. Annotating alerts with recent deployments makes the cause obvious in most cases.

A 30-day plan

WeekFocusOutcome
Week 1Inform: labels and dataMandatory labels defined and enforced, billing export enabled (FOCUS format if available), OpenCost or an equivalent installed, cluster metrics in one place
Week 2Inform: allocation and reportingCost per namespace, team and service with idle and shared cost as separate lines; first showback report reviewed with two teams
Week 3Optimize: quick winsRequests versus p95 usage for the top workloads, first rightsizing changes with SLO checks, orphaned resources removed, non-production schedules in place
Week 4Operate: make it stickCost anomaly alerts, one or two unit cost metrics on a dashboard, telemetry volume per team visible, a monthly review cadence agreed

Measure the result against your own baseline from week 1. Avoid announcing savings targets before you know how your cost is actually distributed.

FinOps for Kubernetes checklist

Copy this checklist into your platform backlog

  • Mandatory labels for team, service, environment and cost center, enforced at admission
  • Same keys used for cloud tags and OpenTelemetry resource attributes
  • Billing export enabled and normalised, ideally in FOCUS format
  • Kubernetes cost data per container, namespace and label, for example via OpenCost
  • Allocation by max(request, usage), with shared and idle cost shown separately
  • Requests compared with p95 CPU and maximum memory usage over a representative period
  • VPA recommendations reviewed; VPA and HPA not acting on the same metric
  • Node pools for different workload shapes; consolidation enabled with disruption budgets
  • Spot capacity only for interruption-tolerant workloads, across several instance types
  • Regular cleanup of orphaned volumes, snapshots, idle load balancers and zombie workloads
  • Non-production environments scaled down outside working hours
  • At least one unit cost metric per key product, tracked over time
  • Telemetry volume, cardinality and retention allocated per team
  • Cost anomaly alerts routed to owning teams, annotated with deployments

How Obseria helps

Obseria is an OpenTelemetry-native observability platform. It does not replace your cloud provider's billing tools, but it gives cost data the engineering context it lacks. Cluster metrics, traces and logs from your workloads arrive correlated, and cost data, for example OpenCost metrics or normalised billing exports, can be brought in as metrics or events and analysed next to them. That lets you build the dashboards and alerts described above in one place, as outlined on our cloud cost management and Kubernetes monitoring pages.

  • Correlated signals connect a cost increase to the deployment, workload and traffic pattern behind it, and Obseria Intelligence helps with root cause analysis when the cause is not obvious.
  • Obseria Pipeline filters, samples, masks and routes telemetry before it is stored, which keeps the cost of observability itself under control.
  • Usage-based pricing per signal with unlimited users means you can give every team access to its own cost and usage data without paying per seat.

If you would like to see how your cluster data looks in Obseria, we are happy to show you in a personal demo.

Share

Observability that delivers answers.

Start for free with OpenTelemetry, no credit card required.