gke-workload-scaling-troubleshooting
Fungsinya
Skill ini mencari tahu mengapa HorizontalPodAutoscaler GKE tidak melakukan scaling sebagaimana mestinya. Skill ini ditujukan untuk tim yang autoscaling-nya berhenti bekerja atau tidak merespons beban.
Kapan dipakai
- βSaat HPA menampilkan metrik sebagai unknown atau mencatat event FailedGetResourceMetric.
- βSaat HPA tidak mau melakukan scale up atau scale down, atau tidak scale ke atau dari nol.
- βSaat metrik kustom atau eksternal yang digunakan untuk autoscaling berhenti bekerja.
Link skill
https://github.com/google/skills/blob/main/skills/cloud/gke-workload-scaling-troubleshooting/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βAutoscaler GKE saya menampilkan CPU sebagai unknown dan tidak pernah menambah pod. Cari tahu mengapa.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini mengumpulkan detail beban kerja, HPA, dan cluster, lalu memeriksa event, permintaan resource, dan pipeline metrik. Skill ini melaporkan penyebabnya dan mengusulkan perbaikan berupa perubahan manifes atau konfigurasi.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah skill ini mengubah autoscaler saya?
Tidak. Diagnosisnya hanya membaca, dan perubahan yang diusulkan diterapkan oleh Anda.
Event mana yang diperiksa?
Event seperti FailedGetResourceMetric, FailedGetScale, dan FailedComputeMetricsReplicas.
Apakah mengatur autoscaling dari awal?
Tidak. Konfigurasi HPA dan VPA ditangani oleh skill gke-workload-scaling.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 22k
- Peringkat
- #10302
- Lisensi
- Apache-2.0
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
finding-google-skills
22kMembantu agent Anda menemukan panduan Google yang tepat untuk tugas pengaturan, seperti hosting, database, penyimpanan, login, atau penyajian model AI.
gcloud
22kMembantu agent Anda menulis dan memeriksa perintah gcloud Google Cloud, dengan mencari sintaks yang tepat sebelum menjalankan apa pun agar tidak menebak flag.
google-cloud-recipe-auth
22kMemandu agent Anda melalui identitas dan akses Google Cloud, termasuk cara orang dan layanan masuk serta izin apa yang mereka dapatkan.
google-cloud-recipe-onboarding
22kMemandu pengembang baru melalui langkah pertama di Google Cloud, termasuk memilih proyek, menautkan penagihan, dan men-deploy sumber daya pertama.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.