Skip to main content
← All posts·
Kubernetes

Kubernetes Cost Optimization for AI Workloads: Cutting GPU Spend by 40% Without Sacrificing Performance

AI infrastructure costs are spiraling. Here's how to optimize Kubernetes cluster costs for GPU workloads — spot instances, right-sizing, scheduling, and autoscaling.

Luca Berton9 min read

The biggest line item in any AI platform budget is GPU compute. A single NVIDIA H100 instance runs $25–$40/hour on major cloud providers. A modest training cluster of 8 GPUs costs $200–$320/hour — over $5,000/day if running 24/7. Most organizations waste 40–60% of their GPU spend on idle capacity, over-provisioned instances, and unoptimized scheduling. Here's how to fix that.

Measure Before You Optimize

Deploy cost visibility first. You can't optimize what you can't measure.

  • Kubecost or OpenCost — Per-namespace, per-workload cost allocation. Shows actual spend vs allocated resources.
  • DCGM Exporter + Prometheus — GPU utilization metrics. The gap between allocated GPUs and utilized GPUs is your waste.
  • Custom dashboards — GPU utilization heatmaps by team. Cost per training job. Cost per inference request.

Typical finding: GPU utilization in non-optimized clusters averages 15–30%. Data scientists request 4 GPUs, use 1.5, and the remaining 2.5 sit idle. Interactive notebooks hold GPU allocations during lunch breaks and meetings.

Right-Sizing GPU Requests

Kubernetes resource requests determine scheduling. If a pod requests 1 GPU, it gets 1 GPU — even if it only uses 30% of it. Strategies:

  • MIG partitioning — For inference and small workloads, use A100 MIG slices instead of whole GPUs. A 1g.5gb MIG slice is ~1/7 the cost of a full A100.
  • Profile-based sizing — Analyze workload profiles. Most inference workloads need 1 GPU with 8-16GB memory. Most training workloads need 2-4 GPUs. Only foundation model training needs 8+ GPUs.
  • Automatic right-sizing — Use VPA (Vertical Pod Autoscaler) recommendations for CPU/memory. For GPUs, build custom recommendations based on DCGM utilization data.
📘 Book

Kubernetes Recipes

A practical guide for container orchestration and deployment by Grzegorz Stencel & Luca Berton (Apress).

Watch on Skillshare →

Spot/Preemptible Instances for Training

Training jobs are inherently fault-tolerant — they checkpoint periodically and can resume from the last checkpoint. This makes them ideal for spot instances, which cost 60-90% less than on-demand.

  • Checkpoint frequently — Every 15-30 minutes for large training jobs
  • Use Kueue preemption — When spot capacity is reclaimed, Kueue requeues the job
  • Mixed node pools — On-demand for inference (needs stability), spot for training (needs scale)
  • Multi-cloud spot — Spread training across cloud providers for better spot availability

Cluster Autoscaling

Scale to zero when idle. GPU nodes are the most expensive resources in your cluster — they should not run when unused.

  • Karpenter (AWS) or Cluster Autoscaler — Provision GPU nodes on demand, deprovision after idle timeout
  • Scale-to-zero for inference — Use KEDA or Knative to scale inference deployments to zero when no traffic. Scale up on first request (with cold start considerations).
  • Scheduled scaling — If your data scientists work 9-to-5, scale down GPU nodes at night and weekends. 70% cost reduction with zero impact on productivity.
🎓 Course

Evaluating RAG Solutions

Choose the right RAG model, configure, test, and optimise.

Start on Pluralsight →

Notebook Lifecycle Management

Jupyter notebooks are GPU killers. Data scientists launch notebooks with GPU access, do exploratory work, leave for lunch, attend meetings — GPU allocated the whole time. Solutions:

  • Idle timeout — Automatically shut down notebooks after 30 minutes of inactivity
  • GPU detach on idle — Remove GPU allocation when notebook kernel is idle, reattach when code executes
  • Scheduled windows — GPU-enabled notebooks available 8am-8pm, CPU-only outside those hours

The 40% Savings Breakdown

In our experience, a typical AI platform achieves 40%+ cost reduction through: spot instances for training (15-20% savings), right-sizing with MIG (8-12% savings), idle scaling and notebook management (10-15% savings), and reserved instances for baseline inference (5-8% savings).

📋 Free Resource

EU AI Act Compliance Checklist

40-point checklist covering risk classification, data governance, transparency, and human oversight. Based on the official regulation.

Get Free Checklist →

What Open Empower Delivers

We implement GPU cost optimization as part of our platform engineering services. From Kubecost deployment to spot instance strategies to autoscaling configuration — we help you run more AI workloads on less infrastructure spend.

kubernetes
cost optimization
gpu
ai infrastructure
finops

Need help applying this in your organization?

Get a free 30-minute assessment with actionable recommendations — whether we work together or not.

Book Your Free AI Platform Assessment

Or see AI readiness assessment scope & pricing

18+ years experience · Ex-Red Hat & Dell · Speaker at KubeCon EU 2026

Luca Berton

Written by

Luca Berton

CEO at Open Empower. 18+ years building enterprise infrastructure at JPMorgan Chase, Red Hat & Dell. Author of 9 technical books. Speaker at Red Hat Summit and KubeCon EU 2026. Instructor on Coursera, Pluralsight & Udemy.

Get more insights like this

Practical AI infrastructure and platform engineering guides — delivered to your inbox.

Subscribe to Newsletter →