Jesus Paz · 2 min read
How to Estimate the Cost of Each Namespace in Kubernetes (With Real Examples)
Walk through two anonymized namespaces and learn the math behind their monthly AWS charges.
Namespace-level reporting strikes the perfect balance: detailed enough for owners, simple enough for finance. Let’s break down two real examples (names changed) using ClusterCost data.
Example 1: payments-prod
| Component | Monthly cost | Notes |
|---|---|---|
| Node usage | $23,420 | Mix of m6i.4xlarge and r6i.2xlarge, 70% utilization |
| Storage | $3,180 | gp3 volumes for Postgres and Redis |
| Load balancers | $1,950 | Dedicated ALB for checkout API |
| Observability | $640 | Loki + Tempo ingest attributed by log volume |
| Total | $29,190 |
How we calculated it:
- Tagged nodes with
namespace=payments-produsing ClusterCost’s automatic namespace mapping. - Allocated ALB cost 100% to the namespace because it serves only payments traffic.
- Distributed shared observability tooling by log volume (namespace produced 32% of cluster logs).
Insights: Checkout jobs reserve too much memory—ClusterCost’s rightsizing reports flagged 40% headroom, representing ~ $4k/month in potential savings.
Example 2: growth-experiments
| Component | Monthly cost | Notes |
|---|---|---|
| Node usage | $6,400 | Spot-heavy node pools with short-lived pods |
| Storage | $420 | Ephemeral volumes only |
| Networking | $310 | Shared NAT weighted by data transfer |
| Idle tax | $550 | Request-based floor to cover reserved buffer |
| Total | $7,680 |
This namespace runs dozens of preview deployments. We applied a hybrid allocation:
- Usage-based for compute (because pods spike and disappear).
- Fixed “idle tax” (10% of workload cost) to ensure the team pays for the standby nodes required to support experiments.
Insights: 30% of cost came from previews older than seven days. Automating namespace TTL cuts spend in half without slowing releases.
How to implement namespace costing
- Ensure metadata quality. Every namespace needs labels for
owner,team,environment,customer. - Collect resource metrics. Deploy ClusterCost to gather CPU/RAM/storage usage and requests.
- Define allocation policies. Request vs. usage? Hybrid? Document the rule per environment.
- Apply shared service multipliers. Ingress, NAT, logging, and CI/CD should be distributed by measurable signals (requests, bytes, builds).
- Publish recurring reports. Weekly dashboards + monthly CSV exports keep everyone aligned.
Communicate with owners
Send each namespace owner a short digest:
- Total cost this month vs. last month.
- Top three workloads driving spend.
- Suggested savings (right-sizing, removing idle resources, switching node types).
- Links to ClusterCost dashboards for self-service drill-down.
Namespace costs stop the finger-pointing. Engineers get numbers they can act on; finance gets line items they can book. Everyone wins.***
Previous
A Practical Guide to Allocating AWS Costs to Teams, Clients, or Environments
Next
The Hidden Ways Kubernetes Makes Your AWS Bill Explode (and How to Fix It)
Related reading
Join 1,000+ FinOps and platform leaders
Get Kubernetes and ECS cost tactics delivered weekly.