Kubernetes Workload Optimizer

Kubernetes Workload Optimizer is an agent for coding agents from Cletrics/finops-agents. It costs 54 tokens per session (1,555 once invoked), scanned A, original, MIT.

A Kubernetes tuning guide that adjusts both container resource settings and the cluster's automatic node scaling. Kubernetes runs containers on shared machines, while requests and limits tell it how much CPU and memory each workload needs.

In plain words
What is it for?
It helps right-size workloads from observed usage, tune Karpenter or Cluster Autoscaler, use VPA recommendations, and design safer spot-instance and consolidation policies.
Why use it?
It helps avoid paying for oversized resource requests while preventing crashes from too little memory or slowdowns from too little CPU. It also balances cheaper node consolidation against scheduling delays, interruptions, and pod restarts.

Agent

Install

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.

agentmods
npx agentmods add agents/cletrics/finops-agents/kubernetes-workload-optimizer
Clone the repo
git clone --depth 1 https://github.com/Cletrics/finops-agents

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Kubernetes Workload Optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/cletrics/finops-agents/kubernetes-workload-optimizer.svg)](https://agentmods.dev/agents/cletrics/finops-agents/kubernetes-workload-optimizer)
Your own site
<a href="https://agentmods.dev/agents/cletrics/finops-agents/kubernetes-workload-optimizer"><img src="https://agentmods.dev/badge/agents/cletrics/finops-agents/kubernetes-workload-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,555 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00054 $0.01555
Opus 5 $0.00027 $0.00777
Sonnet 5 $0.00011 $0.00311
Haiku 4.5 $0.00005 $0.00155

Measured yesterday against content hash 9f7f1333641d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 yesterday.

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.

integrations/opencode/agents/kubernetes-workload-optimizer.md · 160 lines

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:

  1. 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.
  2. 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

  1. Base requests on p95 (CPU) and p99 (memory) of real usage, not p50. Memory OOMs are worse than over-provisioning.
  2. Never remove memory limits without careful consideration. They are the last line of defense against runaway processes.
  3. Beware CPU limits. Many engineering teams choose to set CPU requests but NOT CPU limits to avoid throttling; evaluate per workload.
  4. Roll out per-workload, not cluster-wide. Canary your resource changes like any deploy.
  5. Safety margins: typically 1.3x on memory, 1.5x on CPU above the p99 / p95 reading.

Autoscaling

  1. Pod Disruption Budgets are non-negotiable. Every workload with SLOs has a PDB. No exceptions.
  2. Karpenter consolidation is powerful but chatty. consolidationPolicy: WhenUnderutilized with aggressive consolidateAfter causes unnecessary churn.
  3. Respect the scheduling-latency SLO. Scale-up delay over 90s usually means your pending-pod threshold is wrong or your node provisioner is slow.
  4. Spot requires spread. Diversify instance types and AZs. A single-instance-type spot setup is fragile.
  5. Don't chase 100% utilization. Target 70-80% steady-state utilization to keep headroom for bursts.
  6. 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.

Read the full file on GitHub · 160 lines

Changes

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.

  1. yesterday First seen · 160 lines · 54 tokens per session scan A 9f7f1333641d

Subscribe to this mod's changes

Kubernetes Workload Optimizer is an agent published in the GitHub repository Cletrics/finops-agents (45 stars, last pushed 4mo ago), licensed MIT. It adds 54 tokens to every session and 1,555 once invoked, about $0.0003 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-09-03.