rohitg00/kubectl-mcp-server/k8s-cost

Claude Code and agent skill by rohitg00/kubectl-mcp-server

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Optimize Kubernetes costs through resource right-sizing, unused resource detection, and cluster efficiency analysis. Use for cost optimization, resource analysis, and capacity planning.

Install

npx vskill@latest install rohitg00/kubectl-mcp-server/k8s-cost

SKILL.md

Kubernetes Cost Optimization

Cost analysis and optimization using kubectl-mcp-server's cost tools.

Requires the cost, keda toolsets: start kubectl-mcp-server with --toolsets default,cost,keda (or MCP_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

PriorityRuleImpactTools
1Find and delete unused PVCsCRITICALget_idle_resources
2Right-size overprovisioned podsHIGHget_resource_recommendations
3Identify idle LoadBalancersHIGHkubectl_get
4Scale down non-prod off-hoursMEDIUMkubectl_scale
5Consolidate small namespacesLOWAnalysis

Quick Reference

TaskToolExample
Namespace costget_namespace_cost_allocationget_namespace_cost_allocation(namespace)
Cluster costget_cost_analysisget_cost_analysis()
Unused PVCsget_idle_resourcesget_idle_resources(namespace)
Right-sizingget_resource_recommendationsget_resource_recommendations(namespace)

Quick Cost Analysis

Get Cost Summary
python
get_namespace_cost_allocation(namespace)
get_cost_analysis()
Find Unused Resources
python
get_idle_resources(namespace)
get_idle_resources(namespace)
Resource Right-Sizing
python
get_resource_recommendations(namespace)
kubectl_top(name, namespace)

Cost Optimization Workflow

1. Identify Overprovisioned Resources
python
get_resource_recommendations(namespace="production")
kubectl_top(name, namespace)
kubectl_top(namespace)
2. Find Idle Resources
python
get_idle_resources(namespace)
get_idle_resources(namespace)
3. Analyze Node Utilization
python
kubectl_get(resource_type="nodes")
kubectl_top(resource="nodes")

Right-Sizing Guidelines

Current StateRecommendation
CPU usage < 10% of requestReduce request by 50%
CPU usage > 80% of requestIncrease request by 25%
Memory < 50% of requestReduce request
Memory near limitIncrease limit, monitor OOM

Cost by Resource Type

Compute (Pods/Deployments)
python
kubectl_top(namespace)
kubectl_top(name, namespace)
Storage (PVCs)
python
kubectl_get(resource_type="pvc", namespace)
get_idle_resources(namespace)
Network (LoadBalancers)
python
kubectl_get(resource_type="services", namespace)

Multi-Cluster Cost Analysis

Compare costs across clusters:

python
get_cost_analysis(context="production")
get_cost_analysis(context="staging")
get_cost_analysis(context="development")

Cost Reduction Actions

Immediate Wins
  1. Delete unused PVCs: get_idle_resources() then delete
  2. Right-size pods: Apply get_resource_recommendations()
  3. Scale down dev/staging: Off-hours scaling
Medium-term Optimizations
  1. Use Spot/Preemptible nodes: For fault-tolerant workloads
  2. Implement HPA: Auto-scale based on demand
  3. Use KEDA: Scale to zero for event-driven workloads
Long-term Strategy
  1. Reserved instances: For stable production workloads
  2. Multi-tenant clusters: Consolidate small clusters
  3. 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:

python
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

Security

  • Security scanPassed, 96 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
853
Repository forks
166
Repository npm downloads, 7 days
360
7-day trend score
48

Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 20 Mar 2026, 8 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/rohitg00/kubectl-mcp-server/k8s-cost/badge)](https://verified-skill.com/skills/rohitg00/kubectl-mcp-server/k8s-cost)

Something wrong with this skill or its page? Tell us.