k8s-autoscaling

k8s-autoscaling is a skill for Claude Code, Codex from kudig-io/kudig-database. It costs 21 tokens per session (4,335 once invoked), scanned A, original, Apache-2.0.

A diagnostic and repair guide for Kubernetes autoscaling. Autoscaling adjusts application or cluster capacity based on workload; HPA, VPA, and Cluster Autoscaler are Kubernetes autoscaling components.

In plain words
What is it for?
Use it to diagnose, repair, and verify HPA, VPA, or Cluster Autoscaler problems.
Why use it?
It helps investigate why autoscaling is not working and provides a process for fixing and verifying the result. The description does not specify particular failure causes.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to diagnose, repair, and verify HPA, VPA, or Cluster Autoscaler problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kudig-io/kudig-database/k8s-autoscaling
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kudig-io/kudig-database --skill k8s-autoscaling
Clone the repo
git clone --depth 1 https://github.com/kudig-io/kudig-database

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for k8s-autoscaling

README.md
[![agentmods](https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-autoscaling/github.svg)](https://agentmods.dev/skills/kudig-io/kudig-database/k8s-autoscaling)
Your own site
<a href="https://agentmods.dev/skills/kudig-io/kudig-database/k8s-autoscaling"><img src="https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-autoscaling/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for k8s-autoscaling

Your own site · 80×15
<a href="https://agentmods.dev/skills/kudig-io/kudig-database/k8s-autoscaling"><img src="https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-autoscaling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,335 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.04335
Opus 5.5 $0.00008 $0.01734
Sonnet 5.5 $0.00004 $0.00867
Haiku 4.5 $0.00002 $0.00434

Measured 1mo ago against content hash bc6cda2cd2af, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

k8s-autoscaling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/diagnose-quick.sh, scripts/verify-autoscaling.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

19-故障诊断/08-技能体系/skill-set/k8s-autoscaling/SKILL.md · 342 lines

How it starts

The opening of the file, as written. The whole thing — 342 lines — stays where its author put it; the contents beside it link to each section on GitHub.

生产环境安全提示

本文档包含可直接执行的运维命令。执行前请确认:当前目标集群与 Namespace 是否正确;是否具备足够的 RBAC 权限;是否已在非生产环境验证。命令风险等级标注:🔴 高风险(可能造成数据丢失或服务中断)、🟡 中风险(会修改集群状态,但通常可回滚)、🟢 低风险/只读(信息收集,无副作用)。

K8s Autoscaling Failure 诊断与修复

HPA、VPA 和 Cluster Autoscaler 是 [[kubernetes|Kubernetes]] 弹性能力的核心组件。当自动扩缩容不工作时,应用可能因负载突增而响应缓慢,或因资源浪费而成本过高。

本 [[SKILL|Skill]] 覆盖 HPA 无法获取指标、VPA 推荐不生效、Cluster Autoscaler 无法扩展节点等全部常见根因的诊断和修复。

何时使用此 Skill

症状 检测方法 置信度
HPA TARGET 显示 <unknown> kubectl get hpa 0.95
HPA 不随负载变化扩缩容 压测时观察 kubectl get hpa 0.90
ClusterAutoscaler Pod 异常 `kubectl get [[Pods pods]] -n kube-system
VPA recommendation 为空 kubectl get vpa 0.85
unable to get metrics 事件 kubectl describe hpa 0.95

排除条件: 节点 NotReady → SKILL-NODE-001; 资源配额 → SKILL-RBAC-001

快速分级(2 分钟内完成)

影响范围
├── 核心服务高负载无法扩容 ──────→ P0(15min 内修复)
├── 生产环境成本异常(无法缩容) ─→ P1(30min 内修复)
├── 新 HPA/VPA 规则不生效 ──────→ P2(2h 内修复)
└── 测试环境扩缩容问题 ──────────→ P3(4h 内处理)

立即升级条件:

  • 核心服务因无法扩容导致大面积超时
  • Cluster Autoscaler 导致节点异常增加/减少
  • metrics-server 完全不可用

执行流程

# 🟢 低风险:只读/信息收集,通常无副作用
工单/告警触发
    │
    ▼
┌──────────────┐    脚本: scripts/diagnose-quick.sh
│ Phase 1      │    内容: kubectl 快速检查(只读)
│ 快速检查      │    Step: D1.1-D1.5
└──────┬───────┘
       │ 确认根因
       ▼
┌──────────────┐    参考: reference/remediation-playbook.md
│ 修复操作      │    风险: LOW → MEDIUM → HIGH
│ REM-001~005  │
└──────┬───────┘
       │
       ▼
┌──────────────┐    脚本: scripts/verify-autoscaling.sh
│ 验证确认      │    检查: HPA/VPA/CA 状态
└──────────────┘

可用脚本

脚本 用途 参数 风险
scripts/diagnose-quick.sh 自动扩缩容快速诊断 NAMESPACE HPA_NAME (optional) 只读
scripts/verify-autoscaling.sh 修复后验证 NAMESPACE HPA_NAME (optional) 只读

根因概览 (5 种)

RC ID 根因 概率 首选修复 风险
RC-001 metrics-server 未安装或异常 高 REM-001 修复 metrics-server MEDIUM
RC-002 HPA 指标配置错误 高 REM-002 修正 HPA 配置 LOW
RC-003 VPA admission webhook 问题 中 REM-003 重启 VPA MEDIUM
RC-004 Cluster Autoscaler 权限/配置错误 中 REM-004 修复 CA MEDIUM
RC-005 资源配额或节点池限制 中 REM-005 调整限制 LOW

Read the full file on GitHub · 342 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +19 lines bc6cda2cd2af
  2. 1mo ago First seen · 323 lines · 21 tokens per session scan A 7afa2a7549c4

Subscribe to this mod's changes

k8s-autoscaling is a skill published in the GitHub repository kudig-io/kudig-database (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 21 tokens to every session and 4,335 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

gke-workload-troubleshooting

Diagnoses GKE workload failures (CrashLoopBackOff, OOMKilled, ImagePullBackOff, Pending, etc.) via logs and events. Use when pods fail to start or crash repeatedly. Don't use for GKE cluster infrastructure provisioning, node pool creation, or non-Kubernetes Google Cloud services.

google/skills · 69 tokens

application-integration-troubleshooting

Diagnoses failed, stuck, or silent Google Cloud Application Integration runs and Integration Connectors tasks using the REST API, Cloud Logging, and Cloud Monitoring. Use when an integration fails, returns HTTP 200 without doing the expected work, hangs in a suspended or retry state, or hits IAM, run-as service…

google/skills · 105 tokens

gke-storage-troubleshooting

Diagnoses GKE persistent-storage failures — volume attach/mount errors (Regional PD on optimized VMs, fsGroup mount timeouts), disk-performance and node storage-pressure issues, slow-disk Pod-creation failures, volume-expansion problems, Local SSD / Hyperdisk Storage Pool creation errors, and Cloud Storage FUSE OOM.…

google/skills · 116 tokens

gke-workload-scaling-troubleshooting

Diagnoses GKE HorizontalPodAutoscaler (HPA) failures — metrics showing as , FailedGetResourceMetric / FailedGetScale / FailedComputeMetricsReplicas events, missing Pod resource requests, custom/external metrics-pipeline breakage (FailedGetExternalMetric / FailedGetCustomMetric, unavailable metrics adapter…

google/skills · 170 tokens

gke-ai-troubleshooting-tpu-mxla-hang

Diagnose GKE Cloud TPU multi-slice training hangs (Megascale HANGDETECTED logs and hang monitored events) using the ML Diagnostics Megascale XLA (MXLA) Hang Analyzer (gcloud alpha mldiagnostics monitored-events) and 1-minute Cloud Monitoring multi-slice latency metrics (kubernetes.io/container/multislice/).…

google/skills · 192 tokens

gke-ai-troubleshooting-tpu-performance-degradation

Diagnose GKE Cloud TPU training throughput drops and step-time regressions (15%+ TPU duty-cycle drop) using ML Diagnostics Workload Monitoring (gcloud alpha mldiagnostics monitored-events / hypercomputecluster.googleapis.com/v1alpha) and 1-minute Cloud Monitoring system metrics (kubernetes.io/node/accelerator/).…

google/skills · 200 tokens