Skip to content
All guides

Cost management

Kubernetes Cost Monitoring: From the Invoice Line to the Container

Your cloud bill charges for machines and never names the workload that used them. This guide shows how node-hours become cost per container, and the checks to run before you trust any cost tool's number.

KT

Kubeadapt Team

Updated 5 min read
  • Kubernetes
  • Cost Monitoring
  • FinOps
  • Platform Engineering
Kubernetes Cost Monitoring: From the Invoice Line to the Container

Your cloud bill charges for machines by the hour. Kubernetes decides which workloads run on them and moves pods around all day, so the bill can't say what a team or a service cost.

Kubernetes cost monitoring fills that gap. It prices each node, measures what every container reserved and used, and divides the bill between them. Capacity nobody used shows up as its own number.

Why the bill can't name a workload

The scheduler places each pod on a node with enough unreserved capacity for its requests, and holds that capacity while the pod runs (Kubernetes documentation). One node can host four teams' pods in the morning and two other teams' pods after a rollout, and the invoice records only that it ran.

How node-hours become workload cost

Every Kubernetes cost tool does the same three things:

StepWhat it does
PriceEach node by instance type, region and purchase option, plus volumes, load balancers and the control plane
MeasureEach container's requests and actual use, often enough to catch a short Job
AllocateTurns the node price into rates per vCPU-hour and GiB-hour, and charges each container its share

Idle capacity and shared cost such as kube-system need rules of their own, which the cost allocation guide covers.

Requests, usage, or the greater of the two

The biggest choice is what to charge a container for. Requests match what the scheduler holds, but then a service that reserves 4 vCPU and uses one costs the same as a busy one (the rightsizing guide covers fixing that). Charge for usage and the waste shows up, but everyone else pays for the capacity an over-requesting team blocks.

The usual answer is the greater of the two, the rule in the OpenCost specification and in AWS split cost allocation data. Switch between the three rules here:

What one container is charged for

One checkout-api replica over a weekday (an example). It requests 2 vCPU, idles at night and bursts past its request in the afternoon.

$0.03323 per vCPU-hour: an m6i.2xlarge on demand in us-east-1 ($0.384 an hour, November 2026), split between CPU and memory with the 9:1 weighting AWS uses for split cost allocation data. CPU only; memory is charged the same way. A month is 730 hours.

Chart of one container's CPU over a day: it requests 2 vCPU, uses 1 vCPU on average and bursts to 2.6 vCPU in the afternoon. Charged on requests it pays for 48 vCPU-hours a day, on usage 24, and on the greater of the two 49; about half of what it reserves goes unused.

On the greater-of rule, the replica pays for its whole request all day, plus what it used above that in the two afternoon hours. Charged on usage alone, it would pay for half of what it holds. Measure every minute, since an hourly sample can miss a burst or a five-minute Job entirely.

Worked example: one invoice line down to one container

Take an EKS cluster that ran 40 m6i.2xlarge nodes last month (an example, at on-demand rates in us-east-1, November 2026). Its EC2 line rose by $1,121 and finance wants to know why. Here is the path from that line to one service:

StepResult
The month's EC2 line$11,212.80, at $0.384 per node-hour
Rates, with a vCPU weighted at nine GiB as AWS does$0.03323 per vCPU-hour and $0.003692 per GiB-hour
One checkout-api replica at its request, 2 vCPU and 4 GiB$59.30 a month
Six replicas$355.78 a month
Capacity no container reserved or used$3,353.39, 30% of the line

The idle line comes from node sizes, autoscaler headroom and imperfect bin-packing, so it belongs to whoever runs the platform.

Then price it at what you paid. On a one-year, no-upfront Compute Savings Plan these nodes cost $0.28212 an hour. A tool on list prices reports every workload 36% above the invoice.

The views worth having

QuestionWhat the view needs
What did each team cost?Owners from labels, and a stated rule for idle and shared cost
What changed, and who drove it?Two periods side by side, biggest movers first
Does the total match the invoice?Workload cost on billed rates, discounts and credits included

A FOCUS export puts them next to the rest of the cloud bill.

Checks before you trust the number

What goes wrongHow to catch it
Volumes, load balancers or the control plane go missingTotal one cluster's month against its invoice lines
List prices on discounted capacityCompare the tool's node rate with the effective rate on your bill
Idle hidden, or spread without saying soCheck that the report says which
Hourly samplingRun a five-minute Job and look for it

Then recompute one workload by hand, and scale another up for a day to check that the cost moves there and nowhere else.

Monitoring it yourself

With Prometheus, kube-state-metrics and cAdvisor you can build this yourself. The query below returns each container's charged CPU in cores, the greater of request and five-minute usage, keeping either side when the other is missing:

promql
1(
2  sum by (namespace, pod, container) (rate(container_cpu_usage_seconds_total{container!="", container!="POD"}[5m]))
3    > sum by (namespace, pod, container) (kube_pod_container_resource_requests{resource="cpu"})
4)
5or sum by (namespace, pod, container) (kube_pod_container_resource_requests{resource="cpu"})
6or sum by (namespace, pod, container) (rate(container_cpu_usage_seconds_total{container!="", container!="POD"}[5m]))

Multiply by your vCPU-hour rate and repeat for memory with container_memory_working_set_bytes. For teams, join kube_pod_labels, which carries only the labels in kube-state-metrics' --metric-labels-allowlist. Skip metrics-server: its README says it is meant for autoscaling, not monitoring.

On EKS, split cost allocation data writes pod-level cost into the Cost and Usage Report every hour, with up to 50 Kubernetes labels per pod as cost allocation tags once you activate them. OpenCost, a CNCF incubating project, implements the specification without hand-written queries.

The hard part is the join across usage, prices, discounts, idle, shared cost and label changes, kept fast for 2,000 workloads. Kubeadapt does that join as a hosted service, with no Prometheus server in your cluster.

Following an invoice line to a container in Kubeadapt

Kubeadapt installs as one Helm chart per cluster and shows cost in about five minutes. It computes cost per namespace, workload, node group, pod and container every minute on the greater-of rule, with idle as its own number (how costs are computed).

To answer finance, open Cost Explorer, filter by team and time, and drill from the cluster to the containers behind the increase. Teams come from labels or manual assignment (cost attribution). Connect the AWS Cost and Usage Report (CUR 2.0), Azure Cost Management exports or the Google Cloud billing export, and Kubeadapt reconciles workload cost with the bill: Savings Plans, discounts and credits land on the workload that used them.

Kubeadapt doesn't change your cluster; your team acts on what it shows. A cost spike alert flags the next jump against each scope's own normal range and names the workloads behind it. Kubeadapt MCP answers the same questions from Claude Code or ChatGPT.

See cost monitoring for a tour, or install the agent and compare its first month with your invoice.

Sources

  1. Kubernetes: Resource management for pods and containers
  2. OpenCost specification
  3. AWS: Example of split cost allocation data
  4. AWS: Using Kubernetes labels for cost allocation in EKS
  5. AWS: Amazon EC2 On-Demand pricing
  6. AWS: Compute Savings Plans pricing
  7. AWS: Amazon EKS pricing
  8. kube-state-metrics: Pod metrics
  9. Kubernetes SIGs: metrics-server
  10. FinOps Foundation: FOCUS specification