Why Kubernetes hides costs
On AKS or EKS, the cloud bill shows virtual machines: the nodes. It doesn't say which application consumes what. Without an allocation tool, a shared cluster becomes a black box, and nobody feels responsible for its cost.
Step 1: allocate costs
- One namespace per application, or an application label carrying the CMDB tag.
- An allocation tool: OpenCost (open source, a CNCF project), Kubecost, or the cost analysis built into AKS.
- A share of shared costs (system pods, unused capacity) split according to a clear rule. Recent versions of the FOCUS format provide for exactly this split.
Step 2: adjust requests
The scheduler places pods according to their CPU and memory requests, not their real usage. Overly generous requests force you to add nodes for nothing. Compare requests with real usage (P95) over several weeks, and adjust, for example with Vertical Pod Autoscaler recommendations.
Step 3: fit nodes to the load
- Node autoscaling: cluster autoscaler on AKS, Karpenter or cluster autoscaler on EKS.
- Suitable node pools: VM sizes consistent with the pods, to limit lost capacity.
- Spot for stateless, interruptible workloads, especially in non-prod.
- Reservations or savings plans for the baseline of nodes that run all the time.
Step 4: shut down non-prod
A development or UAT cluster doesn't need to run at night and at weekends. AKS lets you stop a whole cluster; you can also scale node pools to zero outside working hours. It is the same principle as VM Stop/Start.
What to track
| Indicator | What it reveals |
|---|---|
| Requests / real usage | Pod oversizing |
| Node fill rate | Capacity paid for but unused |
| Cost per namespace | Who consumes what |
| Share of Spot and reserved capacity | Rate optimization efficiency |