![Product Name Screen Shot][product-screenshot]
<a href="#installation"><strong>Installation</strong></a>
.
<a href="#how-krr-works"><strong>How KRR works</strong></a>
.
<a href="#free-krr-ui-on-robusta-saas"><strong>Free KRR UI</strong></a>
<a href="#usage">Usage</a>
·
<a href="https://github.com/robusta-dev/krr/issues">Report Bug</a>
·
<a href="https://github.com/robusta-dev/krr/issues">Request Feature</a>
·
<a href="#support">Support</a>
<a href="https://trendshift.io/repositories/7087" target="_blank"><img src="https://trendshift.io/api/badge/repositories/7087" alt="robusta-dev%2Fkrr | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
Robusta KRR (Kubernetes Resource Recommender) is a CLI tool for optimizing resource allocation in Kubernetes clusters. It gathers pod usage data from Prometheus and recommends requests and limits for CPU and memory. This reduces costs and improves performance.
New: Put right-sizing on auto-pilot by applying recommendations automatically. Request beta access.
View Instructions for: Prometheus, Thanos, Victoria Metrics, Google Managed Prometheus, Amazon Managed Prometheus, Azure Managed Prometheus, Coralogix,Grafana Cloud and Grafana Mimir
View instructions for: Seeing recommendations in a UI, Sending recommendations to Slack, Setting up KRR as a k9s plugin, Azure Blob Storage Export with Teams Notification
According to a recent Sysdig study, on average, Kubernetes clusters have:
By right-sizing your containers with KRR, you can save an average of 69% on cloud costs.
Read more about how KRR works
| Feature 🛠️ | Robusta KRR 🚀 | Kubernetes VPA 🌐 |
|---|---|---|
| Resource Recommendations 💡 | ✅ CPU/Memory requests and limits | ✅ CPU/Memory requests and limits |
| Installation Location 🌍 | ✅ Not required to be installed inside the cluster, can be used on your own device, connected to a cluster | ❌ Must be installed inside the cluster |
| Workload Configuration 🔧 | ✅ No need to configure a VPA object for each workload | ❌ Requires VPA object configuration for each workload |
| Immediate Results ⚡ | ✅ Gets results immediately (given Prometheus is running) | ❌ Requires time to gather data and provide recommendations |
| Reporting 📊 | ✅ Json, CSV, Markdown, Web UI, and more! | ❌ Not supported |
| Extensibility 🔧 | ✅ Add your own strategies with few lines of Python | :warning: Limited extensibility |
| Explainability 📖 | ✅ See graphs explaining the recommendations | ❌ Not supported |
| Custom Metrics 📏 | 🔄 Support in future versions | ❌ Not supported |
| Custom Resources 🎛️ | 🔄 Support in future versions (e.g., GPU) | ❌ Not supported |
| Autoscaling 🔀 | 🔄 Support in future versions | ✅ Automatic application of recommendations |
| Default History 🕒 | 14 days | 8 days |
| Supports HPA 🔥 | ✅ Enable using --allow-hpa flag |
❌ Not supported |
KRR requires Prometheus 2.26+, kube-state-metrics & cAdvisor.
Which metrics does KRR need?
No setup is required if you use kube-prometheus-stack or Robusta's Embedded Prometheus.
If you have a different setup, make sure the following metrics exist:
container_cpu_usage_seconds_totalcontainer_memory_working_set_byteskube_replicaset_ownerkube_pod_ownerkube_pod_status_phaseNote: If one of last three metrics is absent KRR will still work, but it will only consider currently-running pods when calculating recommendations. Historic pods that no longer exist in the cluster will not be taken into consideration.
Brew (Mac/Linux)
brew tap robusta-dev/homebrew-krr
brew install krr
krr --help
krr simple
Windows
You can install using brew (see above) on WSL2, or install from source (see below).
Docker image, binaries, and airgapped installation (offline environments)
You can download pre-built binaries from Releases or use the prebuilt Docker container. For example, the container for version 1.8.3 is:
us-central1-docker.pkg.dev/genuine-flight-317411/devel/krr:v1.8.3
We do not recommend installing KRR from source in airgapped environments due to the headache of installing Python dependencies. Use one of the above methods instead and contact us (via Slack, GitHub issues, or email) if you need assistance.
In-Cluster
Apart from running KRR as a CLI tool you can also run KRR inside your cluster. We suggest installing KRR via the Robusta Platform . It gives you a free UI with some features like the following * View application usage history graphs on which recommendations are based. * Get application, namespace and cluster level recommendations. * YAML configuration to apply the suggested recommendation and more


You can also run KRR in-cluster as a Kubernetes Job, if you don't want to view results easily in a UI.
kubectl apply -f https://raw.githubusercontent.com/robusta-dev/krr/refs/heads/main/docs/krr-in-cluster/krr-in-cluster-job.yaml
From Source
git clone https://github.com/robusta-dev/krr
cd ./krr)pip install -r requirements.txt
python krr.py --help
Notice that using source code requires you to run as a python script, when installing with brew allows to run krr.
All above examples show running command as krr ..., replace it with python krr.py ... if you are using a manual installation.
Setup KRR for... - Google Cloud Managed Prometheus - Azure Managed Prometheus - Amazon Managed Prometheus - Coralogix Managed Prometheus - Grafana Cloud Managed Prometheus - Grafana Mimir
Trusting custom Certificate Authority (CA) certificate:
If your llm provider url uses a certificate from a custom CA, in order to trust it, base-64 encode the certificate, and store it in an environment variable named CERTIFICATE
We highly recommend using the free Robusta SaaS platform. You can:
Basic usage
krr simple
Tweak the recommendation algorithm (strategy)
Most helpful flags:
--cpu-min Sets the minimum recommended cpu value in millicores--mem-min Sets the minimum recommended memory value in MB--history_duration The duration of the Prometheus history data to use (in hours)More specific information on Strategy Settings can be found using
krr simple --help
Giving an Explicit Prometheus URL
If your Prometheus is not auto-connecting, you can use kubectl port-forward for manually forwarding Prometheus.
For example, if you have a Prometheus Pod called `kub