gke-workload-scaling-troubleshooting
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…
Install / Use
npx skills add google/skills --skill gke-workload-scaling-troubleshootingInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Tags
Our assessment of gke-workload-scaling-troubleshooting
gke-workload-scaling-troubleshooting scores 97/100 on our quality scale, 98th of 1,267 Automation skills we index (top 8%).
Its SKILL.md is 17 KB long, well organised into 13 sections with 3 code examples: a thorough specification that gives an agent plenty to work with.
With 20,340 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 2 days ago, so gke-workload-scaling-troubleshooting is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-09-26. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
gke-workload-scaling-troubleshooting compared with similar skills
All 4 of these similar skills score higher than gke-workload-scaling-troubleshooting; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| gke-workload-scaling-troubleshooting (this skill)by google | 97 | 20.3k | 2d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 85.4k | 10d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 73.3k | 1d ago | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 83.7k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 3d ago | SKILL.md |
Frequently asked questions
- How do I install gke-workload-scaling-troubleshooting?
- Run
npx skills add google/skills --skill gke-workload-scaling-troubleshooting. The install tabs above show the steps for each supported agent. - Which AI agents does gke-workload-scaling-troubleshooting work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is gke-workload-scaling-troubleshooting safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is gke-workload-scaling-troubleshooting still maintained?
- The repository was last updated 2 days ago, so gke-workload-scaling-troubleshooting is actively maintained.
Skill content
View source on GitHubname: gke-workload-scaling-troubleshooting metadata: version: "1.0.0" category: Containers description: >- 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 errors. Don't use for configuring or authoring new HPA/VPA objects or scaling best practices (see the gke-workload-scaling skill), or for Cluster Autoscaler / node-pool sizing.
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.
🔍 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 Clusters).
Step 2: Resolution — Route to the Matching Branch
Based on the signal you classified in Step 1, jump to one of the mutually-exclusive branches below (A–F). These are alternatives — you do not run them in sequence. After applying the branch's fix, go to Step 3 to present it as a reviewable GitOps change.
Branch A: HorizontalPodAutoscaler Configuration Errors
-
FailedGetScale—unable to get the target's current scale: ... "TARGET" not found: thescaleTargetRefdoesn't resolve to an existing scalable workload.- Verify the
scaleTargetRefname,kind, andapiVersionexactly match the target workload's metadata. - Confirm the target workload exists in the same namespace as the HPA
(a missing
-nputs objects indefault, causing a mismatch). - The target must be a scalable kind (Deployment, StatefulSet, ReplicaSet) — you cannot autoscale a DaemonSet.
- Verify the
-
FailedComputeMetricsReplicas—invalid metrics (1 invalid out of 1): the metrictypeandtargetdon't match.- If
type: Utilization, the target must beaverageUtilization. - If
type: AverageValue, the target must beaverageValue.
- If
-
unable to fetch metrics from external metrics API: googleapi: Error 400: Metric label: 'LABEL' is not allowed: an invalid key inmetric.selector.matchLabels.- Remove or correct the disallowed label; find valid filterable labels in the Cloud Monitoring metric documentation.
-
Replica count fluctuates / contradictory
SuccessfulRescaleevents from different HPAs: more than one HPA targets the same workload viaspec.scaleTargetRef, and they compete. There is no dedicated condition for this — confirm withkubectl get hpa -n {workload_namespace} -o yamland look for duplicatescaleTargetRefvalues.- Consolidate all metrics into one HPA object (it takes the highest of
its
spec.metrics) and delete the duplicates.
- Consolidate all metrics into one HPA object (it takes the highest of
its
Branch B: Workload & Service Errors
-
ScalingActive: False, reasonFailedGetResourceMetric, messageunable to compute the replica count(or a persistentunable to fetch pod metrics): the HPA computes utilization as a percentage of the container resource request, but at least one container in the Pod is missing aresources.requestsentry for the scaled resource (cpuormemory).- Add
resources.requestsfor the scaled resource to every container in the Pod spec (including sidecars). A briefunable to fetch pod metricsright after the metrics server starts is normal and self-heals.
- Add
-
multiple services selecting the same target of HPA_NAME: SERVICE: traffic-based autoscaling requires a one-to-one Service↔workload relationship, but more than one Service's selector matches the workload's Pods.- Make the intended Service's selector unique (add a distinct label to the workload and to that one Service), or tighten the other Services' selectors so they no longer match the workload's Pods.
Branch C: Metrics API & Data Availability (Custom / External Metrics)
The custom/external pipeline is: HPA controller → Kubernetes metrics API server
→ metrics adapter (for example custom-metrics-stackdriver-adapter) → metric
source (Cloud Monitoring / Prometheus). Symptoms are <unknown> metric values or
FailedGetExternalMetric / FailedGetCustomMetric events.
-
Is the adapter registered and available?
kubectl get apiservice | grep -E 'NAME|metrics.k8s.io'Expect
v1beta1.custom.metrics.k8s.ioand/orv1beta1.external.metrics.k8s.iowithAVAILABLE: True. IfFalse/missing, the adapter is crashed or misconfigured — inspect its Pod logs in thecustom-metricsorkube-systemnamespace for permission, connectivity, or "metric not found" errors. -
Query the metrics API directly (bypasses the HPA to test the whole pipeline;
jqoptional):kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1/namespaces/{workload_namespace}/{metric_name}" | jq . kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/namespaces/{workload_namespace}/pods/*/{metric_name}" | jq . -
Interpret the result:
- Valid JSON with a value → the pipeline works; the fault is in the HPA
manifest (metric-name typo or wrong
matchLabels). Error from server (Service Unavailable)→ network isolation is blocking the control plane from reaching the adapter. Add the adapter'stargetPortto the control-plane firewall rule (in addition to the existingtcp:443andtcp:10250). Identify the rule withgcloud compute firewall-rules list --filter="name~gke-{cluster_name}-[0-9a-z]*-master", and also confirm no NetworkPolicy blocks ingress to the adapter Pods.- Empty list
[]→ the adapter runs but can't retrieve the metric. Inspect the adapter Pod logs, and confirm in Metrics Explorer that the metric actually exists in the source with the expected name and labels.
- Valid JSON with a value → the pipeline works; the fault is in the HPA
manifest (metric-name typo or wrong
-
unable to fetch metrics from custom metrics API: no known available metric versions found: a communication breakdown (control plane briefly unavailable during an upgrade/repair, or the adapter Pods are unhealthy or not registered) — not a problem at the metric source. Check control-plane health/notifications, confirm the adapter Pods areRunningwith no restarts (kubectl get pods -n custom-metrics,kube-system -o wide), and re-verify the APIServices areAVAILABLE: True. Often transient. -
googleapi: Error 400: The supplied filter ... will not return any time series: the query is valid but no data matched (different from a value of0) — the application wasn't writing the metric during the window. Verify the metric name/labels match what the app emits, confirm the app had permission and was active, and check the app logs for metric-emission errors.
Branch D: Healthy but Unexpected Scaling Behavior
The HPA's conditions are True and it shows no errors, but scaling doesn't
happen as expected.
- Won't scale up — check, in order:
- Replica limits:
currentReplicasis already atminReplicas/maxReplicas(see theScalingLimitedcondition); adjust the bounds. - Tolerance window: Kubernetes ignores changes while the
current/target ratio stays within
0.9–1.1(default 10% tolerance). Example: target 85% CPU, current 93% → ratio ≈ 1.094
- Replica limits:
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
85.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
73.3k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Scrapling
83.7k🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
