Kubernetes Cost Optimization
БесплатноЗапускает вложенные скриптыНе проверенOptimize Kubernetes costs through resource right-sizing, unused resource detection, and cluster efficiency analysis. Use for cost optimization, resource…
от rohitg00285 установок в других каталогахОб этом скилле
Kubernetes Cost Optimization
Cost analysis and optimization using kubectl-mcp-server's cost tools.
Requires the
cost,kedatoolsets: start kubectl-mcp-server with--toolsets default,cost,keda(orMCP_TOOLSETS=default,cost,keda).
When to Apply
Use this skill when:
- User mentions: "cost", "savings", "optimize", "expensive", "budget"
- Operations: cost analysis, right-sizing, cleanup unused resources
- Keywords: "how much", "reduce", "efficiency", "waste", "overprovisioned"
Priority Rules
| Priority | Rule | Impact | Tools |
|---|---|---|---|
| 1 | Find and delete unused PVCs | CRITICAL | get_idle_resources |
| 2 | Right-size overprovisioned pods | HIGH | get_resource_recommendations |
| 3 | Identify idle LoadBalancers | HIGH | kubectl_get |
| 4 | Scale down non-prod off-hours | MEDIUM | kubectl_scale |
| 5 | Consolidate small namespaces | LOW | Analysis |
Quick Reference
| Task | Tool | Example |
|---|---|---|
| Namespace cost | get_namespace_cost_allocation |
get_namespace_cost_allocation(namespace) |
| Cluster cost | get_cost_analysis |
get_cost_analysis() |
| Unused PVCs | get_idle_resources |
get_idle_resources(namespace) |
| Right-sizing | get_resource_recommendations |
get_resource_recommendations(namespace) |
Quick Cost Analysis
Get Cost Summary
get_namespace_cost_allocation(namespace)
get_cost_analysis()
Find Unused Resources
get_idle_resources(namespace)
get_idle_resources(namespace)
Resource Right-Sizing
get_resource_recommendations(namespace)
kubectl_top(name, namespace)
Cost Optimization Workflow
1. Identify Overprovisioned Resources
get_resource_recommendations(namespace="production")
kubectl_top(name, namespace)
kubectl_top(namespace)
2. Find Idle Resources
get_idle_resources(namespace)
get_idle_resources(namespace)
3. Analyze Node Utilization
kubectl_get(resource_type="nodes")
kubectl_top(resource="nodes")
Right-Sizing Guidelines
| Current State | Recommendation |
|---|---|
| CPU usage < 10% of request | Reduce request by 50% |
| CPU usage > 80% of request | Increase request by 25% |
| Memory < 50% of request | Reduce request |
| Memory near limit | Increase limit, monitor OOM |
Cost by Resource Type
Compute (Pods/Deployments)
kubectl_top(namespace)
kubectl_top(name, namespace)
Storage (PVCs)
kubectl_get(resource_type="pvc", namespace)
get_idle_resources(namespace)
Network (LoadBalancers)
kubectl_get(resource_type="services", namespace)
Multi-Cluster Cost Analysis
Compare costs across clusters:
get_cost_analysis(context="production")
get_cost_analysis(context="staging")
get_cost_analysis(context="development")
Cost Reduction Actions
Immediate Wins
- Delete unused PVCs:
get_idle_resources()then delete - Right-size pods: Apply
get_resource_recommendations() - Scale down dev/staging: Off-hours scaling
Medium-term Optimizations
- Use Spot/Preemptible nodes: For fault-tolerant workloads
- Implement HPA: Auto-scale based on demand
- Use KEDA: Scale to zero for event-driven workloads
Long-term Strategy
- Reserved instances: For stable production workloads
- Multi-tenant clusters: Consolidate small clusters
- Right-size node pools: Match workload requirements
Automated Analysis Script
For comprehensive cost analysis, see scripts/find-overprovisioned.py.
KEDA for Cost Savings
Scale to zero with KEDA:
keda_scaledobjects_list(namespace)
keda_scaledobject_get(name, namespace)
KEDA reduces costs by:
- Scaling pods to 0 when idle
- Event-driven scaling (queue depth, etc.)
- Cron-based scaling for predictable patterns
Related Skills
- k8s-autoscaling - HPA, VPA, KEDA
- k8s-troubleshoot - Resource debugging
Установить Kubernetes Cost Optimization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Kubernetes Cost Optimization?
Optimize Kubernetes costs through resource right-sizing, unused resource detection, and cluster efficiency analysis. Use for cost optimization, resource analysis, and capacity planning.
Как установить скилл Kubernetes Cost Optimization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Kubernetes Cost Optimization запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic