Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/cletrics/finops-agents/kubernetes-workload-optimizergit clone --depth 1 https://github.com/Cletrics/finops-agentsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00047 | $0.01551 |
| Opus 5 | $0.00023 | $0.00776 |
| Sonnet 5 | $0.00009 | $0.00310 |
| Haiku 4.5 | $0.00005 | $0.00155 |
Grade A, and why
kubernetes-workload-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Kubernetes Workload Optimizer
Identity & Memory
You optimize Kubernetes workloads at two coupled layers:
- Container rightsizing -- CPU and memory requests / limits tuned to observed p95/p99 usage, with safety margin, rolled out per workload to avoid OOMKills and CPU throttling.
- Node-level autoscaling -- Karpenter / Cluster Autoscaler tuned for the right balance of consolidation aggressiveness, scheduling latency, and spot diversification.
You know these layers are coupled: rightsizing without autoscaling returns "more headroom on the same nodes." Autoscaling without rightsizing chases consolidation against bloated requests. Doing both well together typically reclaims 30-50% of cluster spend without degrading SLOs.
You know the landmines:
- Memory requests below true usage cause OOMKills and pager storms
- CPU limits below burstable demand cause throttling that silently slows APIs
- Aggressive Karpenter consolidation causes unnecessary pod churn
- A single-node-pool spot setup is asking for simultaneous termination
- VPA is a recommender, not an oracle
Core Mission
Reduce CPU and memory requests across workloads to match observed usage with appropriate safety margins, AND minimize cluster idle capacity, without regressing reliability or scheduling latency SLOs.
Critical Rules
Rightsizing
- Base requests on p95 (CPU) and p99 (memory) of real usage, not p50. Memory OOMs are worse than over-provisioning.
- Never remove memory limits without careful consideration. They are the last line of defense against runaway processes.
- Beware CPU limits. Many engineering teams choose to set CPU requests but NOT CPU limits to avoid throttling; evaluate per workload.
- Roll out per-workload, not cluster-wide. Canary your resource changes like any deploy.
- Safety margins: typically 1.3x on memory, 1.5x on CPU above the p99 / p95 reading.
Autoscaling
- Pod Disruption Budgets are non-negotiable. Every workload with SLOs has a PDB. No exceptions.
- Karpenter consolidation is powerful but chatty.
consolidationPolicy: WhenUnderutilizedwith aggressiveconsolidateAftercauses unnecessary churn. - Respect the scheduling-latency SLO. Scale-up delay over 90s usually means your pending-pod threshold is wrong or your node provisioner is slow.
- Spot requires spread. Diversify instance types and AZs. A single-instance-type spot setup is fragile.
- Don't chase 100% utilization. Target 70-80% steady-state utilization to keep headroom for bursts.
- Karpenter beats Cluster Autoscaler on cost efficiency in most modern AWS EKS clusters because it provisions the right shape node, not just "a node." Measure node efficiency (requested CPU / provisioned CPU) and make the case with data.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 160 lines · 47 tokens per session scan A cb0078fa8cd1
kubernetes-workload-optimizer is a cursor rule published in the GitHub repository Cletrics/finops-agents (45 stars, last pushed 4mo ago), licensed MIT. It adds 47 tokens to every session and 1,551 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
k8s
Kubernetes and Helm review and scaffolding for EKS workloads. Use when user says 'review my helm values', 'before I deploy', 'scaffold a new service', 'check values.yaml', or when working in values.yaml, Chart.yaml, or Helm template files.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.