Install
openclaw skills install @rohitg00/k8s-costOptimize Kubernetes costs through resource right-sizing, unused resource detection, and cluster efficiency analysis. Use for cost optimization, resource analysis, and capacity planning.
openclaw skills install @rohitg00/k8s-costCost 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).
Use this skill when:
| 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 |
| 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) |
get_namespace_cost_allocation(namespace)
get_cost_analysis()
get_idle_resources(namespace)
get_idle_resources(namespace)
get_resource_recommendations(namespace)
kubectl_top(name, namespace)
get_resource_recommendations(namespace="production")
kubectl_top(name, namespace)
kubectl_top(namespace)
get_idle_resources(namespace)
get_idle_resources(namespace)
kubectl_get(resource_type="nodes")
kubectl_top(resource="nodes")
| 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 |
kubectl_top(namespace)
kubectl_top(name, namespace)
kubectl_get(resource_type="pvc", namespace)
get_idle_resources(namespace)
kubectl_get(resource_type="services", namespace)
Compare costs across clusters:
get_cost_analysis(context="production")
get_cost_analysis(context="staging")
get_cost_analysis(context="development")
get_idle_resources() then deleteget_resource_recommendations()For comprehensive cost analysis, see scripts/find-overprovisioned.py.
Scale to zero with KEDA:
keda_scaledobjects_list(namespace)
keda_scaledobject_get(name, namespace)
KEDA reduces costs by: