k8s-cost

0
0
Source

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

Install

mkdir -p .claude/skills/k8s-cost && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7299" && unzip -o skill.zip -d .claude/skills/k8s-cost && rm skill.zip

Installs to .claude/skills/k8s-cost

About this skill

Kubernetes Cost Optimization

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

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 PVCsCRITICALfind_orphaned_pvcs
2Right-size overprovisioned podsHIGHget_resource_recommendations
3Identify idle LoadBalancersHIGHget_services
4Scale down non-prod off-hoursMEDIUMscale_deployment
5Consolidate small namespacesLOWAnalysis

Quick Reference

TaskToolExample
Namespace costget_namespace_costget_namespace_cost(namespace)
Cluster costget_cluster_costget_cluster_cost()
Unused PVCsfind_orphaned_pvcsfind_orphaned_pvcs(namespace)
Right-sizingget_resource_recommendationsget_resource_recommendations(namespace)

Quick Cost Analysis

Get Cost Summary

get_namespace_cost(namespace)
get_cluster_cost()

Find Unused Resources

find_unused_resources(namespace)
find_orphaned_pvcs(namespace)

Resource Right-Sizing

get_resource_recommendations(namespace)
get_pod_metrics(name, namespace)

Cost Optimization Workflow

1. Identify Overprovisioned Resources

get_resource_recommendations(namespace="production")

get_pod_metrics(name, namespace)
get_resource_usage(namespace)

2. Find Idle Resources

find_orphaned_pvcs(namespace)

find_unused_resources(namespace)

3. Analyze Node Utilization

get_nodes()
get_node_metrics()

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)

get_resource_usage(namespace)
get_pod_metrics(name, namespace)

Storage (PVCs)

get_pvc(namespace)
find_orphaned_pvcs(namespace)

Network (LoadBalancers)

get_services(namespace)

Multi-Cluster Cost Analysis

Compare costs across clusters:

get_cluster_cost(context="production")
get_cluster_cost(context="staging")
get_cluster_cost(context="development")

Cost Reduction Actions

Immediate Wins

  1. Delete unused PVCs: find_orphaned_pvcs() 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:

keda_scaledobjects_list_tool(namespace)
keda_scaledobject_get_tool(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

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

9521,094

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

846846

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

571699

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

548492

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

673466

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

514280

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.