Open source · MIT licence

Find the Kubernetes pods you're paying for but not using.

OptiK8s compares what each pod requests with what it actually uses. It flags the over-provisioned ones, suggests new CPU and memory requests, and estimates what you'd save each month.

Python 3.9+ · CLI and web dashboard · try it without a cluster

optik8s metrics analyze
optik8s metrics analyze --input samples/ecommerce.json
╭────────────────────────────────────╮
│ Overprovision Analysis             │
│ Thresholds – CPU: 30%  Memory: 30% │
╰────────────────────────────────────╯
                Summary                 
╭─────────────────────────────┬────────╮
│ Metric                      │  Value │
├─────────────────────────────┼────────┤
│ Total deployments           │      7 │
│ Total pods                  │      7 │
│ Overprovisioned deployments │      7 │
│ Overprovisioned pods        │      7 │
│ Est. monthly savings        │ $39.83 │
╰─────────────────────────────┴────────╯
                                                        Pod Resource Analysis                                                        
╭───────────────┬───────────┬────────────────┬───────┬─────────────┬────────────────────┬───────┬─────────────┬────────────┬────────╮
│ Pod           │ Namespace │ CPU Used / Req │ CPU % │ CPU Suggest │     Mem Used / Req │ Mem % │ Mem Suggest │ Savings/mo │ Status │
├───────────────┼───────────┼────────────────┼───────┼─────────────┼────────────────────┼───────┼─────────────┼────────────┼────────┤
│ storefront-1  │ default   │      5m / 146m │  3.6% │          6m │    13 MiB / 69 MiB │ 18.3% │      14 MiB │      $5.08 │ ⚠ HIGH │
├───────────────┼───────────┼────────────────┼───────┼─────────────┼────────────────────┼───────┼─────────────┼────────────┼────────┤
│ product-api-2 │ default   │     16m / 188m │  8.7% │         18m │   71 MiB / 354 MiB │ 20.1% │      78 MiB │      $7.04 │ ⚠ HIGH │
├───────────────┼───────────┼────────────────┼───────┼─────────────┼────────────────────┼───────┼─────────────┼────────────┼────────┤
│ postgres-1    │ default   │     58m / 342m │ 16.8% │         63m │ 933 MiB / 1584 MiB │ 58.9% │           — │      $9.63 │ ⚠ WARN │
├───────────────┼───────────┼────────────────┼───────┼─────────────┼────────────────────┼───────┼─────────────┼────────────┼────────┤
│ redis-1       │ default   │      6m / 146m │  3.8% │          6m │  184 MiB / 430 MiB │ 42.9% │           — │      $4.83 │ ⚠ WARN │
╰───────────────┴───────────┴────────────────┴───────┴─────────────┴────────────────────┴───────┴─────────────┴────────────┴────────╯

Real output from the e-commerce sample that ships with OptiK8s, trimmed to four of its seven pods.

How it works

Requests versus real usage

Kubernetes bills you for what pods request, not what they use. Requests tend to be set once, generously, and never looked at again.

01 · Collect

Read actual usage

OptiK8s reads per-pod CPU and memory usage from Prometheus. Or give it a JSON file if you'd rather export the numbers yourself.

02 · Analyse

Flag the waste

Any pod using less than 30% of its request is flagged. Both thresholds are adjustable. The suggested request is observed usage plus 10% headroom.

03 · Estimate

Put a price on it

Each pod gets a monthly saving estimate. The defaults are $0.048 per vCPU-hour and $0.006 per GiB-hour of memory. Change them in optik8s/core/rules.py to match your own bill.

Features

Also in the box

Try it without a cluster

Six sample datasets and a workload simulator, so you can see what it does before pointing it at anything real.

optik8s simulate run --scenario ecommerce

Local or AWS clusters

Create a three-node KIND cluster on your laptop, or an EKS cluster on AWS, with one command each.

optik8s cluster create kind

Monitoring included

Installs Prometheus and Grafana with Helm (kube-prometheus-stack) if your cluster doesn't have them yet.

optik8s monitoring install

Sample workloads

Five ready-made apps to deploy and measure: a Node.js web server, a FastAPI service, Spring PetClinic, PostgreSQL and Redis.

Web dashboard

Check your tools, create and switch clusters, and deploy or remove apps from the browser.

optik8s ui

Scripts and summaries

--json output for CI or your own reports. Optional plain-English summaries through the OpenAI API, with rule-based messages when no key is set.

Quick start

Running in a minute

You need Python 3.9 or newer. The sample file stands in for a cluster, so nothing else is required for the first run.

For a real cluster, make Prometheus reachable (by default on localhost:9090) and run optik8s metrics analyze without --input. Creating clusters also needs Docker, kind, kubectl and, for EKS, eksctl.

# get the code
git clone https://github.com/47-Cloud/OptiK8s.git
cd OptiK8s
pip install -e .

# analyse the bundled sample data
optik8s metrics analyze --input samples/overprovisioned.json

# see every command
optik8s --help