The cloud bill shows nodes, not teams. A cluster with 20 namespaces is one big shared cost until you allocate it.
flowchart LR NODES["Node cost from the bill"] --> OC["OpenCost / Kubecost"] REQ["Pod requests and usage"] --> OC OC --> NS["Cost per namespace, label, workload"] OC --> IDLE["Idle: capacity nobody requested"] NS --> RS["Right-size requests"] IDLE --> BP["Bin packing and autoscaling"] %% step NODES: Providers bill VMs, disks and load balancers; the cluster itself is opaque. %% step REQ: Pod CPU and memory requests reserve capacity whether they are used or not. %% step OC: OpenCost (a CNCF project) combines prices with requests and usage to allocate cost. %% step NS: Cost per namespace or label maps to teams, just like tags elsewhere. %% step IDLE: Capacity no pod requested is idle cost — usually shared out or shown separately. %% step RS: Lowering inflated requests is the biggest lever; then nodes can shrink.
How allocation works
Each pod is charged for max(request, usage) of CPU and memory, multiplied by the node's price per CPU-hour and GB-hour. Persistent volumes and load balancers are added directly. Unrequested capacity is idle cost.
Optimisation levers
| Lever | What it does |
|---|---|
| Right-size requests | Requests close to real usage (e.g. Vertical Pod Autoscaler recommendations) |
| Horizontal Pod Autoscaler | Scale replicas with load instead of sizing for peak |
| Cluster autoscaler / Karpenter | Add and remove nodes, consolidate pods onto fewer nodes |
| Spot node pools | Run stateless and batch workloads on spot capacity |
| Namespace quotas and LimitRanges | Stop unbounded requests; give defaults |
| Schedule dev clusters | Scale node pools to zero after hours |
Typical numbers to watch
- Request efficiency: usage ÷ requests per namespace — 20–30% is common before optimisation.
- Cluster idle: allocatable capacity not requested.
- Cost per namespace per day, shown to the team that owns it.
Traps: allocating by usage only (teams that over-request look cheap while blocking capacity); setting requests lower than real needs, which causes throttling and evictions; and putting stateful workloads on spot nodes without disruption handling.