gke-workload-scaling-troubleshooting
できること
GKEのHorizontalPodAutoscalerが、なぜ期待どおりにスケールしないかを調べます。オートスケーリングが止まった、または負荷に反応しないチーム向けです。
使う場面
- ✓HPAがメトリクスを不明と表示し、FailedGetResourceMetricのイベントを記録しているとき。
- ✓HPAがスケールアップまたはスケールダウンせず、ゼロへのスケールもしないとき。
- ✓オートスケーリングに使うカスタムまたは外部のメトリクスが、動かなくなったとき。
スキルのリンク
https://github.com/google/skills/blob/main/skills/cloud/gke-workload-scaling-troubleshooting/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のGKEのオートスケーラーはCPUを不明と表示し、ポッドを増やしません。その理由を調べてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、ワークロード、HPA、クラスタの詳細を集め、イベント、リソースのリクエスト、メトリクスのパイプラインを確認します。原因を報告し、マニフェストまたは設定の変更として修正を提案します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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
よくある質問
オートスケーラーを変更しますか?
いいえ。診断は読み取り専用で、変更は提案されてあなたが適用します。
どのイベントを確認しますか?
FailedGetResourceMetric、FailedGetScale、FailedComputeMetricsReplicasなどのイベントです。
オートスケーリングをゼロから設定しますか?
いいえ。HPAとVPAの設定は、gke-workload-scalingのスキルが扱います。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 22k
- ランキング
- #10302
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
finding-google-skills
22kセットアップ作業に合うGoogleの公式ガイドを探すようエージェントを支援します。ホスティング、データベース、ストレージ、サインイン、AIモデルの提供などが対象です。
gcloud
22kエージェントが、Google CloudのgcloudコマンドについてWeb検索に頼らず、正確な構文を確かめてから書いたり確認したりできるよう支援します。
google-cloud-recipe-auth
22kエージェントが、Google Cloudのアイデンティティとアクセス(人やサービスがどうサインインし、どの権限を得るか)について、手順を案内できるよう支援します。
google-cloud-recipe-onboarding
22k新しい開発者が、プロジェクトの選択、請求の設定、最初のリソースのデプロイなど、Google Cloudの最初の手順を進められるよう案内します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。