get-resource-usage

X-McKay's avatarfrom X-McKay

Get resource usage metrics for nodes and pods. Uses Kubernetes metrics server to retrieve CPU and memory usage. Use for capacity planning or investigating resource issues. Keywords: resource usage, CPU, memory, metrics, capacity.

⭐1stars🔀0forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

This Claude skill provides real-time visibility into Kubernetes cluster health by retrieving CPU and memory usage metrics for both nodes and pods. By integrating with the Kubernetes metrics server, it empowers users to perform capacity planning, investigate resource-related performance issues, and optimize infrastructure costs through data-driven insights.

Use Cases

  • Capacity Planning: Evaluate current node utilization to determine if the cluster requires scaling or if workloads should be redistributed.
  • Troubleshooting Performance Issues: Identify 'noisy neighbor' pods or nodes experiencing resource exhaustion to resolve application latency or crashes.
  • Resource Optimization: Detect underutilized resources to right-size pod requests and limits, effectively reducing cloud infrastructure spend.
  • Cluster Health Auditing: Quickly assess the overall resource distribution across all namespaces to ensure balanced workload allocation and stability.
nameget-resource-usage
description>
resource issues. Keywordsresource usage, CPU, memory, metrics, capacity.
domaink8s
categorycollection
requires-approvalfalse
confidence0.85

Get Resource Usage

Preconditions

Before applying this skill, verify:

  • Metrics server is installed and running
  • Cluster has metrics-server or equivalent

Actions

1. Get Node Resource Usage

Retrieve CPU and memory usage for all nodes.

mcp_tool: kubernetes-mcp-server/nodes_top
params: {}
timeout: 30s

2. Get Pod Resource Usage

Retrieve CPU and memory usage for pods.

mcp_tool: kubernetes-mcp-server/pods_top
params:
  all_namespaces: true
timeout: 30s

3. Get Node Stats Summary

Get detailed stats from kubelet for specific node.

mcp_tool: kubernetes-mcp-server/nodes_stats_summary
params:
  name: $node_name
timeout: 30s

Success Criteria

The skill succeeds when:

  • Metrics retrieved for all nodes
  • CPU and memory values are valid
  • No errors from metrics API

Failure Handling

If metrics are unavailable:

  1. Check if metrics-server is running
  2. Verify node kubelet is responsive
  3. Return partial data if some nodes fail

Examples

Output:

{
  "nodes": [
    {
      "name": "node1",
      "cpu_percent": 45,
      "memory_percent": 62,
      "cpu_cores": "2000m",
      "memory_bytes": "4Gi"
    }
  ],
  "top_pods": [
    {
      "name": "vllm-abc123",
      "namespace": "vllm",
      "cpu": "1500m",
      "memory": "16Gi"
    }
  ]
}