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 thisSizes 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 theserecommended 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.
pipx install git+https://github.com/fabiocicerchia/k8s-rightsizer-reportOr with pip:
pip install git+https://github.com/fabiocicerchia/k8s-rightsizer-reportpipx install .
k8s-rightsizer-report -n production # needs kubectl + metrics-server
k8s-rightsizer-report -n production --json # feed dashboardsmake dev then make test / make lint.
Need help implementing this? Get in touch.
Apache 2.0 — see LICENSE.