Official agent skill

Gke Cost Optimization

by google in google/skills

Optimizes GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas.

OfficialApache-2.0Auto-check passedDevOps & Cloud

Install Gke Cost Optimization

skills CLI
$ npx skills add google/skills --skill gke-cost-optimization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install google/skills gke-cost-optimization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/google/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cloud/gke-cost-optimization .claude/skills/gke-cost-optimization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gke-cost-optimization
GitHub stars
21k
Token cost
~2.1k tokens
SKILL.md length
812 words
Files
4 (incl. assets)
Skills in repo
145
Repo updated
First seen
Licence
Apache-2.0

At a glance

Optimizes GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas.

  • Works in 7 steps: Prerequisite: Cost Allocation & Monitoring → Configure Resource Quotas → Pod Rightsizing (VPA & MPA) → …
  • Optimizing GKE cluster
  • SKILL.md covers Workflows & Optimization… and Cost & Utilization Monitoring
  • Calls kubectl, gcloud and bq

What it does

Gke Cost Optimization is an agent skill from google/skills, published by the product's own GitHub organization. Optimizes GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas. Use when optimizing GKE cluster or workload costs, configuring GKE cost allocation or quotas, rightsizing CPU/memory requests, or selecting Spot VMs and machine types. Don't use for general compute class provisioning or GPU Selection (use gke-compute-classes instead).

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including assets (for example `assets/resource-quota-example.yaml`, `assets/spot-deployment-example.yaml` and `assets/vpa-recommendation-mode.yaml`).

It sits in DevOps & Cloud, covering Cloud cost optimization. It works with Google Kubernetes Engine. The repository describes itself as: Agent Skills for Google products and technologies. The licence is Apache-2.0.

When your agent uses it

  • Optimizing GKE cluster
  • Configuring GKE cost allocation
  • Rightsizing CPU/memory requests
  • Selecting Spot VMs and machine types

Example prompts

  • “Use the gke-cost-optimization skill to optimiz GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas”
  • “/gke-cost-optimization”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Prerequisite: Cost Allocation & Monitoring
  2. Configure Resource Quotas
  3. Pod Rightsizing (VPA & MPA)
  4. Spot VMs via ComputeClasses & NodeSelector
  5. Machine Type Selection
  6. Committed Use Discounts (CUDs)
  7. Cluster Management & Multi-Tenancy

What it can do on your machine

Read from SKILL.md and the folder at commit 8a1ac05. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • kubectl
    • gcloud
    • bq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use kubectl and gcloud, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gke Cost Optimization loads about 2.1k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 812 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from google/skills at commit 8a1ac05, republished under its Apache-2.0 licence (© google). 812 words, ~2,084 tokens.

Download SKILL.mdSave it as .claude/skills/gke-cost-optimization/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
gke-cost-optimization
description
Optimizes GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas. Use when optimizing GKE cluster or workload costs, configuring GKE cost allocation or quotas, rightsizing CPU/memory requests, or selecting Spot VMs and machine types. Don't use for general compute class provisioning or GPU Selection (use gke-compute-classes instead).
metadata.version
1.0.0
metadata.category
CloudObservabilityAndMonitoring

GKE Cost Optimization

This reference covers strategies and workflows for reducing Google Kubernetes Engine (GKE) costs while maintaining a secure and reliable posture.

Workflows & Optimization Strategies

1. Prerequisite: Cost Allocation & Monitoring

To enable GKE cost allocation (--enable-cost-allocation) for billing tracking across namespaces and labels, inspect live cluster utilization (kubectl top), or run historical cost breakdown queries in BigQuery (bq), use the gke-cost-analysis skill. Once tracking is active and waste is diagnosed, apply the optimization workflows below.

2. Configure Resource Quotas

Resource quotas restrict total resource consumption across tenants in multi-tenant clusters, preventing runaway costs. Template: assets/resource-quota-example.yaml (set namespace + hard limits, then kubectl apply -f).

3. Pod Rightsizing (VPA & MPA)

Adjust pod resource requests to match actual utilization. Over-provisioned requests are one of the largest sources of waste.

  • Use VPA in Recommendation Mode (updateMode: "Off" — recommends without evicting):
bash
# 1. Deploy VPA in recommendation mode (template: assets/vpa-recommendation-mode.yaml)
kubectl apply -f assets/vpa-recommendation-mode.yaml
# 2. Wait 24+ hours for data collection, then read recommendations
kubectl get vpa {deployment_name}-vpa -o jsonpath='{.status.recommendation}'
  • Optimization Rules:
ConditionActionSavings
CPU request >5x P95 actualReduce to P95 * 1.2High
Memory request >3x P95 actualReduce to P95 * 1.2High
CPU request >2x P95 actualReduce to P95 * 1.2Medium
No resource requests setAdd requests (enables bin-packing)Medium
  • Use MPA: Reconcile HPA and VPA recommendations when scaling both horizontally and vertically to avoid conflicting scale events.
  • Review Cost Recommendations: Check Google Cloud Console (Cost Management > GKE Cost Optimization) for built-in rightsizing suggestions.
4. Spot VMs via ComputeClasses & NodeSelector

Use Spot VMs for fault-tolerant workloads to achieve 60-90% cost reduction.

4.1 ComputeClass Configuration

For a Spot-first ComputeClass with On-Demand fallback (priority ordering, activeMigration, machine family selection), use the gke-compute-classes skill — ComputeClass YAML generation and priority configuration are its domain, not this skill's.

4.2 Direct Workload Spot Selection (nodeSelector)

For stateless or batch workloads in GKE Autopilot, target Spot capacity directly using nodeSelector:

[!WARNING] Preemption Warning: Spot VMs are interruptible and can be preempted at any time with a 30-second notice. Workloads must be fault-tolerant and run with at least 2 replicas for high availability. Always explicitly warn users about this preemption risk when recommending Spot VMs.

The exact Pod-level selector is:

yaml
nodeSelector:
  cloud.google.com/gke-spot: "true"

Full worked Deployment (replicas >= 2, terminationGracePeriodSeconds: 25, preStop hook): assets/spot-deployment-example.yaml.

Spot-Suitable Workloads:

WorkloadSpot-Suitable?
Batch / data processingYes
Dev / test environmentsYes
Stateless web/API (replicas >= 2)Yes (with PDBs)
Jobs with checkpointingYes
Stateful workloads (databases)No
Single-replica critical servicesNo
5. Machine Type Selection

When choosing node shapes or configuring ComputeClasses:

FamilyUse CaseRelative Cost
e2General purpose, burstableLowest
t2a / t2dScale-out (Arm/AMD), price-performance optimizedLow
n4aAxion Arm-based, general-purpose price-performanceLow
n4 / n4dGeneral purpose (Intel/AMD), flexible shapesLow-Medium
c4aAxion Arm-based, general-purpose, high efficiencyMedium
c3 / c4Compute-optimized (Intel)Medium-High
c3d / c4dCompute-optimized (AMD), high throughputMedium-High
ek-standardAutopilot enhancedMedium
m3 / x4Memory-optimized, SAP HANA, large databasesHigh
g2 (L4 GPU)AI inferenceHigh
a3 (H100 GPU)AI trainingHighest
a4 / a4xUltra-scale AI (Blackwell GPUs)Highest
Show full SKILL.md (346 more words)Show less
6. Committed Use Discounts (CUDs)

For steady-state workloads with predictable baseline usage, purchase 1-year or 3-year CUDs:

  • Resource-based CUDs (committed to a machine family/region): roughly high-30s% discount for 1-year, ~55% for 3-year (varies by machine family).
  • Flexible CUDs (spend-based, portable across families/regions): lower discounts (~28% 1-year, ~46% 3-year) in exchange for flexibility.
  • Autopilot: Autopilot-specific CUDs were retired in January 2026 — new commitments covering Autopilot usage are spend-based Compute Flexible CUDs (existing Autopilot CUD commitments run out their term).
  • Applied automatically to matching usage across the region.
  • Purchase via Google Cloud Console > Billing > Committed use discounts.

Size the commitment to the steady-state baseline only. A commitment bills for the full term whether or not you use it, so over-committing to peak usage converts a discount into waste. Measure the floor of actual usage over a representative period, commit to that, and cover everything above it with the elastic options already in this skill:

  • Baseline (always running) → resource-based CUDs.
  • Variable / bursty → autoscaling on on-demand capacity.
  • Interruption-tolerant (batch, CI, stateless workers) → Spot VMs, which stack with autoscaling and need no commitment.

When recommending CUDs, state the split explicitly rather than implying the whole footprint should be committed.

7. Cluster Management & Multi-Tenancy
  • Idle dev clusters: GKE has no stop/start operation, and the cluster management fee accrues as long as the cluster exists. To cut idle costs, scale node pools to zero (gcloud container clusters resize {cluster_name} --node-pool {pool_name} --num-nodes 0) or delete and recreate the cluster via IaC (Terraform/Config Connector).
  • Right-size node pools (Standard): Use Cluster Autoscaler with appropriate min/max limits.
  • Cheap warm headroom instead of overprovisioned nodes: Standby capacity buffers (Preview, GKE 1.36.0-gke.2253000+) keep pre-initialized nodes suspended — you pay only disk + IP instead of full node price, with ~30s resume. See the gke-cluster-autoscaler skill.
  • Multi-tenant consolidation: Share a single cluster across multiple engineering teams instead of maintaining per-team clusters, using Namespaces and ResourceQuotas to isolate workloads.

Cost & Utilization Monitoring

To inspect live node/pod utilization (kubectl top nodes/pods), view cluster cost budgets (gcloud billing budgets list), or query detailed billing reports in BigQuery (bq query), refer to the gke-cost-analysis skill.

© google, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (assets) in skills/cloud/gke-cost-optimization of google/skills.

  • SKILL.md
  • assets/resource-quota-example.yaml
  • assets/spot-deployment-example.yaml
  • assets/vpa-recommendation-mode.yaml

Open the folder on GitHubat commit 8a1ac05

Compare with similar skills

Gke Cost Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gke Cost Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gke Cost Optimization this skillgoogle/skills21k—~2.1kAutomated safety check: PassApache-2.0
Vercel Optimize Auditvercel-labs/agent-skills32k8 repos~4.3kAutomated safety check: PassNone
Cloud Cost Optimizationwshobson/agents40k13 repos~1.7kAutomated safety check: PassMIT
Trigger.dev Cost Savings Auditpapermark/papermark9.2k—~1.3kAutomated safety check: PassCustom licence
Kubernetes SpecialistJeffallan/claude-skills12k1 repos~2.1kAutomated safety check: PassMIT
Axiom Cost Controlopenclaw/clawhub9.5k—~1.7kAutomated safety check: PassMIT

Similar skills

  • Vercel Optimize Audit

    vercel-labs/agent-skills

    Official

    Runs a metrics-first audit of a deployed Vercel project, gating investigations on real signals to produce ranked, citation-backed cost and performance recommendations.

    32k GitHub starsUsed in 8 repos~4.3k tokens
    DevOps & CloudAuto-check passed
  • Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.

    40k GitHub starsUsed in 13 repos~1.7k tokens
    DevOps & CloudAuto-check passed
  • Audits Trigger.dev tasks, schedules and run history for wasteful machine sizes, retries, polling and cron frequency to cut spend.

    9.2k GitHub stars~1.3k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Kubernetes Specialist

    Jeffallan/claude-skills

    Creates and checks Kubernetes manifests, Helm charts, RBAC and network policies, and helps debug pod problems, with kubectl checks and rollback steps.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    DevOps & CloudAuto-check passed
  • Axiom Cost Control

    openclaw/clawhub

    Finds unused data in Axiom by analyzing query patterns, then deploys a cost dashboard and ingest monitors to keep spend under the contract limit.

    9.5k GitHub stars~1.7k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Devops

    nicepkg/auto-company

    Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm).

    192 GitHub starsUsed in 2 repos~814 tokens
    DevOps & CloudAuto-check passed

More from google/skills

All 145 skills in this repo
  • Official

    Manages Google Cloud Privileged Access Manager entitlements and grants: create and edit entitlements, request temporary access, and approve or deny pending grants.

    21k GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Official

    Writes Terraform alerting policies for AI agents that emit OpenTelemetry metrics, covering reliability, cost, safety, security and quality signals on Google Cloud.

    21k GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Official

    Deploys open models or custom weights from Model Garden to Agent Platform endpoints, checks deployment status and cleans up endpoints, confirming before any change.

    21k GitHub stars~5.1k tokensUpdated today
    Auto-check passed
  • Official

    Searches, manages and scaffolds skills in the Gemini Enterprise Agent Platform Skill Registry using bundled Python scripts and Google Cloud credentials.

    21k GitHub stars~584 tokensUpdated today
    Auto-check passed
  • Designs GCP infrastructure as local Terraform, validates and scans it against best practices, then imports it to Application Design Center for deployment and troubleshooting.

    21k GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Official

    Analyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans.

    21k GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Gke Cost Optimization

What does Gke Cost Optimization do?

Optimizes GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas. Gke Cost Optimization is an agent skill from google/skills, published by the product's own GitHub organization. Optimizes GKE costs, rightsizes workloads, and configures Spot VMs, CUDs, cost allocation, and resource quotas.

When should I use Gke Cost Optimization?

Gke Cost Optimization fits situations like: optimizing GKE cluster; configuring GKE cost allocation; rightsizing CPU/memory requests; selecting Spot VMs and machine types.

How do I install Gke Cost Optimization in Claude Code?

Run `npx skills add google/skills --skill gke-cost-optimization -a claude-code`. Or copy the skill folder (skills/cloud/gke-cost-optimization in google/skills) into .claude/skills/gke-cost-optimization in your project. Claude Code loads it when a task matches its description.

How do I install Gke Cost Optimization in Codex?

Run `npx skills add google/skills --skill gke-cost-optimization -a codex`. Or copy the skill folder (skills/cloud/gke-cost-optimization in google/skills) into .agents/skills/gke-cost-optimization in your project. Codex loads it when a task matches its description.

Can I use Gke Cost Optimization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google/skills --skill gke-cost-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gke-cost-optimization, .gemini/skills/gke-cost-optimization, .github/skills/gke-cost-optimization and .opencode/skills/gke-cost-optimization in your project.

What does Gke Cost Optimization need to run?

Going by SKILL.md and its folder, Gke Cost Optimization needs the command-line tools its instructions call (kubectl, gcloud and bq).

Does Gke Cost Optimization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Gke Cost Optimization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Gke Cost Optimization use?

Gke Cost Optimization is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gke Cost Optimization use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Gke Cost Optimization?

Skills that share tags, products or a category with Gke Cost Optimization: Vercel Optimize Audit (vercel-labs/agent-skills, 32k stars), Cloud Cost Optimization (wshobson/agents, 40k stars), Trigger.dev Cost Savings Audit (papermark/papermark, 9.2k stars) and Kubernetes Specialist (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gke Cost Optimization?

google (a GitHub organization, an official publisher) maintains it in google/skills, which has 20,994 GitHub stars. The repository holds 145 skills in this directory. The repository was last updated on October 6, 2026.

Source: google/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.