gke-workload-scaling-troubleshooting
What it does
This skill finds why a GKE HorizontalPodAutoscaler is not scaling the way it should. It is for teams whose autoscaling has stopped working or does not react to load.
When to use it
- βWhen an HPA shows metrics as unknown or logs FailedGetResourceMetric events.
- βWhen an HPA will not scale up or down, or does not scale to or from zero.
- βWhen a custom or external metric used for autoscaling stops working.
Skill link
https://github.com/google/skills/blob/main/skills/cloud/gke-workload-scaling-troubleshooting/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βMy GKE autoscaler shows the CPU as unknown and never adds pods. Find out why.β
5 new skills a week. 1 minute to read.
How it works
It collects the workload, HPA and cluster details, then checks events, resource requests and the metrics pipeline. It reports the cause and proposes corrections as manifest or config changes.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
GKE Workload Scaling Troubleshooting Skill
Use this skill to systematically diagnose and resolve HorizontalPodAutoscaler
(HPA) failures on GKE β metrics reported as <unknown>, FailedGet* events,
missing resource requests, custom/external metrics-pipeline breakage, HPA that
refuses to scale up or down, scale-to/from-zero issues, and slow HPA reaction on
large clusters. This skill operates non-interactively and enforces a read-only
diagnostics boundary before proposing manifest or configuration corrections.
For configuring HPA/VPA objects and scaling best practices, use the
gke-workload-scalingskill instead. This skill focuses on failure diagnosis.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-workload-scaling-troubleshooting)"
and append agent-skills/1.0 (skill:gke-workload-scaling-troubleshooting) to User-Agent headers.
π Diagnosis & Resolution Workflow
Step 0: Non-Interactive Context Discovery & Dry-Run Fallback
Parameter Extraction: Extract required context (
project_id,cluster_name,cluster_location,hpa_name,workload_name,workload_namespace) non-interactively from the user prompt, activeSETTINGS.md, or environment defaults:- Default
workload_namespacetodefaultif omitted. - Infer missing cluster parameters from the active environment (
kubectl config current-contextorgcloud config get-value project).
- Default
Cluster Credentials & Fallback Mode:
- Attempt credential fetch:
gcloud container clusters get-credentials {cluster_name} --location {cluster_location} --project {project_id}. - Fallback / Dry-Run Mode: If the cluster is unreachable,
non-existent, or live command execution fails (such as in sandboxed
evaluations, dry-run mode, or offline analysis):
- Limit retry attempts to avoid resource exhaustion and context overflow.
- Immediately present the exact
kubectl/gclouddiagnostic commands for the human operator to run. - Synthesize the root-cause analysis and output the proposed GitOps correction based on the reported symptoms.
- Attempt credential fetch:
Step 1: Inspect the HPA and Classify the Symptom
Start every investigation with kubectl describe hpa, then route to the matching
branch. The three key sections are Metrics (an <unknown> value means the
HPA hasn't fetched the metric or the pipeline is broken), Conditions
(AbleToScale, ScalingActive, ScalingLimited β a False status marks a
failure), and Events (specific reasons such as FailedGetScale or
FailedGetResourceMetric).
Diagnostic Commands:
kubectl describe hpa {hpa_name} -n {workload_namespace}
kubectl get hpa {hpa_name} -n {workload_namespace} -o yaml
For historical events, query Cloud Logging (the HPA events survive after the live
Events list rolls over):
resource.type="k8s_cluster"
resource.labels.cluster_name="{cluster_name}"
resource.labels.location="{cluster_location}"
logName="projects/{project_id}/logs/events"
jsonPayload.involvedObject.kind="HorizontalPodAutoscaler"
Route by signal:
FailedGetScale,FailedComputeMetricsReplicas,Error 400 ... label is not allowed, or fluctuating replicas from competing HPAs β Branch A (Configuration Errors).FailedGetResourceMetric,unable to fetch pod metrics, ormultiple services selecting the same targetβ Branch B (Workload & Service Errors).<unknown>custom/external metric,FailedGetExternalMetric/FailedGetCustomMetric, orno known available metric versions foundβ Branch C (Metrics API & Data Availability).- Conditions all
True/ no errors but the workload won't scale up or down β Branch D (Healthy but Unexpected Scaling). - Workload configured with
minReplicas: 0won't scale to or from zero β Branch E (Scale To / From Zero). - Correct HPA but slow reaction on a cluster with many HPA objects β Branch F (Slow Recalculation on Large Cluster
FAQ
Does it change my autoscaler?
No. The diagnosis is read-only, and it proposes changes for you to apply.
Which events does it check?
Events such as FailedGetResourceMetric, FailedGetScale and FailedComputeMetricsReplicas.
Does it set up autoscaling from scratch?
No. Configuring HPA and VPA is handled by the gke-workload-scaling skill.
Details
Original description by the author
Diagnoses GKE HorizontalPodAutoscaler (HPA) failures β metrics showing as <unknown>, FailedGetResourceMetric / FailedGetScale / FailedComputeMetricsReplicas events, missing Pod resource requests, custom/external metrics-pipeline breakage (FailedGetExternalMetric / FailedGetCustomMetric, unavailable metrics adapter, control-plane firewall blocking the adapter), HPA that won't scale up or down (tolerance / stabilization window / unavailable rate metrics), scale-to/from-zero problems, and slow HPA reaction on large clusters. Use when an HPA isn't scaling a workload as expected or reports metric e
repo: google/skills
Popularity
- GitHub stars
- 22k
- Ranking position
- #10302
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
finding-google-skills
22kHelps your agent find the right Google guides for a setup task, such as hosting, databases, storage, sign-in or AI model serving.
gcloud
22kHelps your agent write and check Google Cloud gcloud commands, looking up exact syntax before it runs anything so it does not guess flags.
google-cloud-recipe-auth
22kGuides your agent through Google Cloud identity and access, including how people and services sign in and which permissions they get.
google-cloud-recipe-onboarding
22kWalks a new developer through first steps on Google Cloud, including choosing a project, linking billing, and deploying a first resource.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.