Optimize Kubernetes costs through resource right-sizing, unused resource detection, and cluster efficiency analysis. Use for cost optimization, resource analysis, and capacity planning.
Cost analysis and optimization using kubectl-mcp-server's cost tools.
Use this skill when:
| Priority | Rule | Impact | Tools |
|----------|------|--------|-------|
| 1 | Find and delete unused PVCs | CRITICAL | find_orphaned_pvcs |
| 2 | Right-size overprovisioned pods | HIGH | get_resource_recommendations |
| 3 | Identify idle LoadBalancers | HIGH | get_services |
| 4 | Scale down non-prod off-hours | MEDIUM | scale_deployment |
| 5 | Consolidate small namespaces | LOW | Analysis |
| Task | Tool | Example |
|------|------|---------|
| Namespace cost | get_namespace_cost | get_namespace_cost(namespace) |
| Cluster cost | get_cluster_cost | get_cluster_cost() |
| Unused PVCs | find_orphaned_pvcs | find_orphaned_pvcs(namespace) |
| Right-sizing | get_resource_recommendations | get_resource_recommendations(namespace) |
get_namespace_cost(namespace)
get_cluster_cost()
find_unused_resources(namespace)
find_orphaned_pvcs(namespace)
get_resource_recommendations(namespace)
get_pod_metrics(name, namespace)
get_resource_recommendations(namespace="production")
get_pod_metrics(name, namespace)
get_resource_usage(namespace)
find_orphaned_pvcs(namespace)
find_unused_resources(namespace)
get_nodes()
get_node_metrics()
| 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 |
get_resource_usage(namespace)
get_pod_metrics(name, namespace)
get_pvc(namespace)
find_orphaned_pvcs(namespace)
get_services(namespace)
Compare costs across clusters:
get_cluster_cost(context="production")
get_cluster_cost(context="staging")
get_cluster_cost(context="development")
find_orphaned_pvcs() then deleteget_resource_recommendations()For comprehensive cost analysis, see scripts/find-overprovisioned.py.
Scale to zero with KEDA:
keda_scaledobjects_list_tool(namespace)
keda_scaledobject_get_tool(name, namespace)
KEDA reduces costs by:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer