
gke-scaling
Configures GKE autoscaling, including HPA, VPA, and Node Auto-Provisioning (NAP). Use when configuring GKE autoscaling, setting up GKE HPA, setting up GKE VPA, or configuring GKE NAP. Don't use for configuring static cluster sizes or setting node-level machine styles directly (use gke-compute-classes instead).
- Installs
- 968
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/google/skills --skill gke-scaling- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads gke-scaling automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
GKE Workload Scaling
This reference covers scaling workloads on GKE. The golden path enables VPA, OPTIMIZE_UTILIZATION autoscaling profile, and Node Auto Provisioning by default.
MCP Tools:
get_k8s_resource,describe_k8s_resource,apply_k8s_manifest,patch_k8s_resource,get_cluster,update_cluster,update_node_pool
Golden Path Scaling Defaults
| Setting | Golden Path Value | Notes |
|---|---|---|
autoscaling.autoscalingProfile | OPTIMIZE_UTILIZATION | Aggressive scale-down for cost savings |
verticalPodAutoscaling.enabled | true | VPA recommendations available |
autoscaling.enableNodeAutoprovisioning | true | NAP creates node pools on demand |
| GPU resource limits (T4, A100) | 1000000000 each | NAP can provision GPU nodes |
Scaling Mechanisms
1. Manual Scaling
kubectl-only — no MCP equivalent for
kubectl scale. Use kubectl directly.
kubectl scale deployment <DEPLOYMENT> --replicas=<N> -n <NAMESPACE>
2. Horizontal Pod Autoscaling (HPA)
Scales the number of pods based on metrics.
Quick setup (kubectl-only — no MCP equivalent for kubectl autoscale):
kubectl autoscale deployment <DEPLOYMENT> --cpu-percent=50 --min=1 --max=10
Manifest approach (recommended — use MCP apply_k8s_manifest):
See assets/hpa-example.yaml for a template.
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: <DEPLOYMENT>-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: <DEPLOYMENT>
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
3. Vertical Pod Autoscaling (VPA)
Adjusts CPU and memory requests to match actual usage. Enabled by default on golden path.
Update modes:
Off— recommendations only (safest, start here)Initial— sets resources only at pod creationAuto— restarts pods to apply new resource valuesInPlaceOrRecreate— updates resources without restart when possible (GKE 1.34+)
Create VPA in recommendation mode:
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: <DEPLOYMENT>-vpa
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: <DEPLOYMENT>
updatePolicy:
updateMode: "Off"
Read recommendations (prefer MCP describe_k8s_resource):
# MCP (preferred)
describe_k8s_resource(parent="...", resourceType="verticalpodautoscaler", name="<DEPLOYMENT>-vpa", namespace="<NAMESPACE>")
# kubectl fallback
kubectl get vpa <DEPLOYMENT>-vpa -o jsonpath='{.status.recommendation}'
See assets/vpa-example.yaml for a full template.
4. Cluster Autoscaler / Node Auto Provisioning (NAP)
On Autopilot (golden path), node scaling is fully managed. NAP automatically creates and sizes node pools based on workload demands.
For Standard clusters:
# Enable cluster autoscaler on a node pool
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
--enable-autoscaling --node-pool <POOL_NAME> \
--min-nodes <MIN> --max-nodes <MAX> \
--quiet
# Enable NAP
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
--enable-autoprovisioning \
--min-cpu <MIN_CPU> --max-cpu <MAX_CPU> \
--min-memory <MIN_MEM> --max-memory <MAX_MEM> \
--quiet
Autoscaling profiles:
| Profile | Behavior | Golden Path? |
|---|---|---|
BALANCED | Default GKE; conservative scale-down | No |
OPTIMIZE_UTILIZATION | Aggressive scale-down; lower idle | Yes |
| : : resources : : |
Best Practices
- Define resource requests: HPA and VPA rely on accurate requests. Always set them.
- Avoid metric conflicts: Do not use HPA and VPA on the same metric. Typical pattern: HPA on CPU, VPA on memory.
- Pod Disruption Budgets: Define PDBs for all production workloads to ensure availability during scaling events.
- HPA stabilization: HPA has a default 5-minute stabilization window. Tune
behaviorfor faster response if needed. - VPA "Auto" caution: Auto mode restarts pods. Ensure your app handles SIGTERM gracefully. VPA requires at least 2 replicas for evictions by default.
- Use ComputeClasses: For workload-specific node targeting (Spot fallback, GPU, specific machine families), use ComputeClasses instead of node selectors.
Rightsizing Workflow
- Deploy VPA in
Offmode for 24+ hours - Read recommendations:
kubectl describe vpa <NAME> - Compare
targetvalues against currentrequests - Apply with 20% buffer:
new_request = target * 1.2 - Use patch format to update Deployment
| Condition | Recommendation | Risk |
|---|---|---|
| CPU request >5x P95 actual | Reduce to P95 * 1.2 | Medium |
| Memory request >3x P95 actual | Reduce to P95 * 1.2 | Medium |
| CPU request >2x P95 actual | Rightsizing with 20% buffer | Low |
| No resource limits set | Add limits to prevent noisy-neighbor | Low |
FAQ
What does the gke-scaling skill do?
Configures GKE autoscaling, including HPA, VPA, and Node Auto-Provisioning (NAP). Use when configuring GKE autoscaling, setting up GKE HPA, setting up GKE VPA, or configuring GKE NAP. Don't use for configuring static cluster sizes or setting node-level machine styles directly (use gke-compute-classes instead).
How do I install gke-scaling?
Run npx skills add https://github.com/google/skills --skill gke-scaling in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/gke-scaling/ (personal) or .claude/skills/gke-scaling/ (project).
Which AI agents can use gke-scaling?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is gke-scaling safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains gke-scaling?
It is published by google in google/skills. It has 968 recorded installs.
More from google/skills
bigquery-basics
google/skills
Manages datasets, tables, and jobs in BigQuery. Use when you need to interact with BigQuery, run SQL queries, manage BigQuery resources (datasets, tables, views), or perform basic data ingestion and analysis.
cloud-run-basics
google/skills
Manages Cloud Run services, jobs, and worker pools. Use when you need to deploy applications responding to HTTP requests (services), run event-triggered or scheduled tasks (jobs), or handle always-on pull-based background processing (worker pools).
gemini-api
google/skills
Use when the user asks about using Gemini in an enterprise environment or explicitly mentions Vertex AI, Google Cloud, or Agent Platform. Guides the usage of the Gemini API on Agent Platform with the Google Gen AI SDK. Covers SDK usage (Python, JS/TS, Go, Java, C), capabilities like multimodal inputs, tools, media generation, caching, batch prediction, and Live API.
google-cloud-recipe-auth
google/skills
Provides expert guidance on Identity and Access Management (IAM) and authenticating and authorizing to Google Cloud services and APIs, covering human users, service identities, Application Default Credentials (ADC), and best practices for secure access.
google-cloud-recipe-onboarding
google/skills
Guides a developer's first steps on Google Cloud, covering account creation, billing setup, project management, and deploying a first resource. Use when a new developer wants to initialize their first Google Cloud project, configure billing, and verify deployment. Don't use for enterprise organization setup (use Google Cloud Setup guided flow for that instead). Don't use for complex multi-project architectures.
cloud-sql-basics
google/skills
This file generates or explains Cloud SQL resources. Use this file when the user asks to create a Cloud SQL instance or database for MySQL, PostgreSQL, or SQL Server. Cloud SQL manages third-party MySQL, PostgreSQL, and SQL Server instances as resources in Cloud SQL. For example, when Cloud SQL creates an open-source MySQL instance, the resulting resource is a Cloud SQL for MySQL instance that Google Cloud manages. Cloud SQL handles backups, high availability, and secure connectivity for relational database workloads.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.