Skip to content

k8s-rightsizer-report

CI License: Apache 2.0 Security OpenSSF Scorecard Release

Turns metrics-server usage into PR-ready requests/limits changes: a human-readable rightsizing report, or patch YAML you can commit. Closes the loop that VPA recommendations leave open — getting the numbers into the repo.

$ k8s-rightsizer-report -n app
| kind/workload/container | current req | peak usage | recommended req | Δ cpu |
|---|---|---|---|---|
| Deployment/api/app     | 1000m/1Gi | 180m/210Mi | 250m/288Mi | -75% |
| Deployment/worker/main | (unset)   | 350m/800Mi | 500m/1024Mi | new |

$ k8s-rightsizer-report -n app --diff > rightsizing-patch.yaml   # commit this

Sizes Deployments, StatefulSets, and DaemonSets. Opt a workload or specific containers (sidecars, agents) out via pod-template annotations:

metadata:
  annotations:
    k8s-rightsizer-report/exclude: "true"                       # skip the whole workload
    k8s-rightsizer-report/exclude-containers: "istio-proxy,vault-agent"  # skip just these

Model

recommended request = peak observed usage × headroom (1.4× CPU, 1.25× memory), rounded to sane steps (25m / 32Mi); limits = requests × 2 (CPU) / 1.5 (memory). Deliberately simple and explainable — see roadmap for percentile-based inputs.

Install

pipx install git+https://github.com/fabiocicerchia/k8s-rightsizer-report

Or with pip:

pip install git+https://github.com/fabiocicerchia/k8s-rightsizer-report

Usage

pipx install .
k8s-rightsizer-report -n production            # needs kubectl + metrics-server
k8s-rightsizer-report -n production --json     # feed dashboards

Development

make dev then make test / make lint.

Support

Need help implementing this? Get in touch.

License

Apache 2.0 — see LICENSE.

About

Generates right-sizing recommendations from Kubernetes metrics-server data, outputting a human-readable report or patch YAML ready to commit.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages