Reducing cloud and platform costs without sacrificing delivery: resource right-sizing, cluster optimization with spot and autoscaling, GitOps efficiency itself, and cost monitoring with cost allocation and anomaly detection.

In episode 32 the organization was arranged. Now there's the question that can't be avoided in any real organization: how much does it cost? Cloud costs grow with clusters, and clusters grow with applications — and without discipline, the bill becomes a surprise. In the GitOps world there's good news: every resource decision lives in Git, so cost optimization can be reviewed like any ordinary code change.
This episode discusses cost optimization from three angles: application resources, clusters, and GitOps itself — then how to monitor and allocate costs. Remember the episode 25 principle: measure first, change one thing, measure again.
The biggest waste is usually not applications that lack resources, but ones that request far above what they need. A pod requesting 4 vCPUs but using 0.3 vCPUs wastes space and money. Data from kubectl top and usage metrics shows the mismatch between request and utilization:
kubectl top pods -n api --sort-by=cpu
kubectl top pods -n api --sort-by=memory
kubectl describe pod api-5d4b6c7d9-8xk2m -n apiA healthy target: CPU request utilization around 60–80 percent on average. Below that, shrink the request; consistently above 90 percent, enlarge it.
Requests determine scheduling and quotas; limits determine protection from throttling/OOM. Best practice: realistic requests (from measurement), protective limits (not letting one pod take everything). Use namespace quotas (episode 28) so wasteful requests can't spread.
Recommender mode first — let it give suggestions, then apply them manually (Auto mode can be surprising if used directly).apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: api-vpa
namespace: api
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: api
updateMode: "Off"A cluster with a single homogeneous node pool wastes money on workloads that don't fit. Separate them:
on-demand.Spot instances can save 60–90 percent on compute costs — provided workloads tolerate eviction. In Kubernetes, spot nodes must be labeled, and the applications using them must be able to restart: multi-replica Deployments with topologySpreadConstraints, disruptionBudget, and state outside the pod (databases stay on on-demand nodes).
spec:
template:
spec:
nodeSelector:
node.kubernetes.io/lifecycle: spot
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostnameThe cluster autoscaler adds nodes when pods are Pending due to resources, and removes idle nodes. It's the safety net that makes optimization safe: requests that are too small no longer cause outages because the cluster adjusts. Pair it with HPA for best results: HPA manages replicas, the autoscaler manages nodes.
One multi-tenant cluster (episode 28) is cheaper than many small clusters: idle nodes get filled with other workloads. The downside is isolation complexity — a trade-off that must be calculated per organization, not assumed.
ArgoCD also consumes resources. Its optimization (episode 25) is cost optimization:
--depth 1).ARGOCD_GIT_CONCURRENCY) so the repo server isn't over-provisioned.metadata:
annotations:
argocd.argoproj.io/reconcile-period: 20m
spec:
...Costs that aren't measured can't be optimized. Four monitoring layers:
Resource labels are the foundation of everything — from the start (episode 28): team=, environment=, tenant=, app=. Cloud providers read these labels for cost reports. Undisciplined labels = costs that can't be attributed.
Integrate Kubernetes metrics with cost data. Tools like OpenCost read resource requests and actual usage, then calculate cost per namespace/deployment from provider prices. Combine with ArgoCD metrics (episode 22) to see cost per application.
Cost anomalies are usually a sign of a problem: an application stuck in CrashLoopBackOff (constant restarts = wasted compute), a node pool that never shrinks, or runaway syncs. A simple alert can save thousands of dollars:
groups:
- name: cost
rules:
- alert: DailyCostSpike
expr: sum(increase(cost_daily[1d])) / sum(increase(cost_daily[7d])) > 1.5Warning
Beware of optimizations that only shift costs. Lowering pod requests means the cluster is denser — good. But if done without quotas and autoscaling, it triggers eviction and degradation instead. Cost optimization must be verified against SLOs: costs going down while error rates rise isn't a win.
This episode mapped cost optimization: application right-sizing with real usage data, disciplined request/limits, HPA and VPA, node pool strategies with spot instances and cluster autoscaling, multi-tenancy efficiency, GitOps efficiency through sync frequency tuning, repo size, cache, and networking, and cost monitoring with cost allocation tags, usage tracking, showback/chargeback, and anomaly detection.
The points you should take with you:
Recommender suggests; apply after verification.Costs are under control. Time to make sure everything is ready before really launching into production. In the next episode 34 we discuss production deployment checklist — pre-production checklist, operational practices, common pitfalls, and day-2 operations. See you in episode 34!