gke-cost-optimization

Optimizes GKE cluster costs through rightsizing, Spot VMs, CUDs, and resource quotas.

19.1k|1.5k|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/google/skills --skill gke-cost-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gke-cost-optimization
Source: https://github.com/google/skills/tree/main/skills/cloud/gke-cost-optimization
Command: npx skills add https://github.com/google/skills --skill gke-cost-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

GKE clusters often waste money through over-provisioned resource requests, idle node pools, and missed discount opportunities. This Skill provides concrete workflows to diagnose and reduce GKE spending while maintaining reliability.

Core Features & Use Cases

  • Pod Rightsizing: Deploy VPA in recommendation mode and apply P95-based rules to cut over-provisioned CPU and memory requests.
  • Spot VM & Machine Type Selection: Target Spot capacity via nodeSelector for fault-tolerant workloads and choose cost-efficient machine families (e2, t2d, n4, c4).
  • Committed Use Discounts & Quotas: Size 1-year or 3-year CUDs to the steady-state baseline and enforce ResourceQuotas to prevent runaway multi-tenant costs.
  • Use Case: A platform team notices a rising GKE bill. They use this Skill to rightsize deployments with VPA recommendations, migrate batch jobs to Spot VMs, and purchase resource-based CUDs covering only their baseline usage.

Quick Start

Ask the agent to analyze my GKE workloads and recommend cost optimizations including rightsizing, Spot VMs, and committed use discounts.

Frequently Asked Questions about gke-cost-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce GKE cluster costs?

Reduce GKE costs by rightsizing pod requests with VPA recommendations, running fault-tolerant workloads on Spot VMs for 60-90% savings, purchasing CUDs sized to your steady-state baseline, and scaling idle node pools to zero. Enable cost allocation first to identify waste.

How to use Spot VMs in GKE Autopilot?

Target Spot capacity in GKE Autopilot by adding the nodeSelector cloud.google.com/gke-spot: "true" to your Pod spec. Run at least 2 replicas with terminationGracePeriodSeconds of 25 and a preStop hook, since Spot VMs can be preempted with about 30 seconds notice.

What is the difference between resource-based and flexible CUDs?

Resource-based CUDs commit to a specific machine family and region, offering roughly high-30s percent for 1-year and about 55% for 3-year terms. Flexible CUDs are spend-based and portable across families and regions, with lower discounts around 28% and 46%.

Which workloads are suitable for GKE Spot VMs?

Spot VMs suit batch processing, dev/test environments, stateless web services with 2 or more replicas, and jobs with checkpointing. Stateful workloads like databases and single-replica critical services should not run on Spot capacity due to preemption risk.

When should I not use this GKE cost optimization skill?

Do not use it for general compute class provisioning or GPU selection, which belong to the gke-compute-classes skill. For live utilization inspection, billing budgets, and BigQuery cost queries, use the gke-cost-analysis skill instead.