본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)22k · #10302

gke-workload-scaling-troubleshooting

하는 일

이 스킬은 GKE HorizontalPodAutoscaler가 의도대로 확장되지 않는 이유를 찾습니다. 자동 확장이 멈췄거나 부하에 반응하지 않는 팀을 위한 스킬입니다.

사용하는 경우

  • ✓HPA가 지표를 unknown으로 표시하거나 FailedGetResourceMetric 이벤트를 기록할 때.
  • ✓HPA가 확장이나 축소를 하지 않거나, 0개로 또는 0개에서 확장하지 않을 때.
  • ✓자동 확장에 쓰는 사용자 지정 또는 외부 지표가 작동을 멈출 때.

스킬 링크

https://github.com/google/skills/blob/main/skills/cloud/gke-workload-scaling-troubleshooting/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/cloud/gke-workload-scaling-troubleshooting/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“GKE 자동 확장기가 CPU를 unknown으로 보여 주고 파드를 전혀 추가하지 않습니다. 이유를 찾아 주세요.”

매주 새 스킬 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-scaling skill 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

  1. Parameter Extraction: Extract required context (project_id, cluster_name, cluster_location, hpa_name, workload_name, workload_namespace) non-interactively from the user prompt, active SETTINGS.md, or environment defaults:

    • Default workload_namespace to default if omitted.
    • Infer missing cluster parameters from the active environment (kubectl config current-context or gcloud config get-value project).
  2. 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 / gcloud diagnostic commands for the human operator to run.
      • Synthesize the root-cause analysis and output the proposed GitOps correction based on the reported symptoms.

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, or multiple services selecting the same target → Branch B (Workload & Service Errors).
  • <unknown> custom/external metric, FailedGetExternalMetric / FailedGetCustomMetric, or no 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: 0 won'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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬