explaingit

robusta-dev/krr

4,580PythonAudience · ops devopsComplexity · 3/5LicenseSetup · moderate

TLDR

KRR reads your Kubernetes cluster's real CPU and memory usage from Prometheus and tells you what resource limits you should actually set, cutting wasted cloud spend. MIT-licensed, runs from your laptop with no cluster-side install needed.

Mindmap

mindmap
  root((krr))
    What it does
      Right-sizes k8s resources
      Cuts cloud waste
      Prometheus-based analysis
    Data Sources
      Prometheus
      Thanos and VictoriaMetrics
      Managed cloud Prometheus
    Output Formats
      JSON and CSV
      Markdown report
      Slack weekly digest
    Features
      Auto-apply with Enforcer
      Custom strategy plugins
      Free SaaS dashboard
    Tech Stack
      Python
      Kubernetes
      Prometheus
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Scan a Kubernetes cluster to find containers with over-provisioned CPU and memory and get right-sized recommendations in minutes.

USE CASE 2

Export resource recommendations as CSV and share them with your team before applying changes to production.

USE CASE 3

Set up weekly Slack reports showing which workloads are wasting the most cloud spend and what the recommended values are.

USE CASE 4

Write a custom KRR strategy in Python to tailor recommendations to your team's specific SLO requirements.

Tech stack

PythonKubernetesPrometheus

Getting it running

Difficulty · moderate Time to first run · 30min

Requires an existing Kubernetes cluster with Prometheus (or a compatible data source) already collecting metrics.

Use, modify, and distribute freely for any purpose including commercial, keep the MIT copyright notice.

In plain English

KRR stands for Kubernetes Resource Recommender, a command-line tool that looks at how much CPU and memory your containerized applications are actually using and then tells you what settings you should be using instead. If you run software in a Kubernetes cluster (a system for managing many small, packaged applications), you have to declare in advance how much computing power each piece of software is allowed to use. Most teams guess too high, which means you pay for cloud resources that sit idle. According to a Sysdig study cited in the README, Kubernetes clusters waste an average of 69% of their CPU allocation. KRR fixes this by reading historical usage data from Prometheus, a monitoring tool that tracks metrics over time. You point KRR at your Prometheus server, run the tool from your laptop or from inside the cluster, and it produces a report showing what each container currently has versus what it actually needs. You do not have to install anything inside the cluster to get recommendations, and you do not have to configure each application individually before it starts collecting data. The tool supports several Prometheus-compatible data sources beyond a basic Prometheus setup: Thanos, Victoria Metrics, Google Managed Prometheus, Amazon Managed Prometheus, Azure Managed Prometheus, Coralogix, Grafana Cloud, and Grafana Mimir. Recommendations can be exported as JSON, CSV, Markdown, or viewed through a free web UI on the Robusta SaaS platform, and there is a Slack integration for weekly reports. An auto-apply mode called KRR Enforcer can apply the recommended settings automatically without manual intervention. The free SaaS platform adds explanation graphs showing how each recommendation was calculated, and it includes an AI-powered fix generator for acting on the recommendations. The tool is written in Python, licensed under MIT, and designed to be extended with custom recommendation strategies using a few lines of Python code. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Show me how to run KRR against my Prometheus server to get CPU and memory recommendations for all namespaces, then export the results as CSV.
Prompt 2
I use Google Managed Prometheus, walk me through configuring KRR to point at it and generate a Markdown recommendation report.
Prompt 3
Help me write a custom KRR recommendation strategy in Python that sets requests at the 90th percentile instead of the default.
Prompt 4
Set up a weekly KRR Slack report that posts the top 10 most over-provisioned containers in my cluster every Monday morning.
Prompt 5
Show me how to use KRR Enforcer to automatically apply resource recommendations to non-production namespaces on a schedule.
Open on GitHub → Explain another repo

← robusta-dev on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.