Note
This project is not affiliated with robusta-dev/krr.
Simple KRR dashboard for Kubernetes resource reporting, using robusta-dev/krr to gather data.
- Python 3.13+
- pipenv for dependency management
- robusta-dev/krr for Kubernetes resource reporting data
The dashboard uses data generated by krr using the following command:
krr simple --fileoutput report.table.csv --use-oomkill-data --formatter csv-
Clone the repository
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Unix/macOS # or .venv\Scripts\activate # On Windows
-
Install dependencies:
pipenv install
-
Build the Docker image:
docker build -t simple-krr-dashboard . -
Run the container:
docker run -v $(pwd)/reports:/reports -p 80:80 simple-krr-dashboard
The dashboard will be available at http://localhost:80
To run the dashboard:
pipenv run startOr directly using Python (make sure you're in the project root directory):
PYTHONPATH=src python src/simple_krr_dashboard/main.pyThe Docker container exposes port 80 for the web interface. You can access the dashboard by opening your web browser and navigating to http://localhost:80
# Run tests
pipenv run test
# Run linter
pipenv run lint
# Format code
pipenv run format
# Type checking
pipenv run typecheckThe following environment variables can be used to configure the application:
| Variable | Description | Default | Required |
|---|---|---|---|
APP_NAME |
Name of the application | "Simple KRR Dashboard" | No |
APP_VERSION |
Version of the application | "1.0.0" | No |
KUBERNETES_CLUSTER_NAME |
Name of the Kubernetes cluster | None | No |
KUBERNETES_DASHBOARD_CSV_PATH |
Path to the CSV file containing Kubernetes data | "/reports/report.table.csv" | No |
LOG_LEVEL |
Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) | "INFO" | No |
LOG_FORMAT |
Format string for log messages | "%(asctime)s - %(name)s - %(levelname)s - %(message)s" | No |
LOG_OUTPUT_FORMAT |
Log output format (text, logfmt, json) | "text" | No |
DISABLE_HTTP_LOGS |
Disable HTTP access logs from Gunicorn | "false" | No |
The application uses two types of logs:
- Application Logs: Controlled by
LOG_LEVEL(DEBUG, INFO, WARNING, ERROR, CRITICAL) andLOG_OUTPUT_FORMAT(text, logfmt, json) - HTTP Access Logs: Controlled by
DISABLE_HTTP_LOGS(true/false)
The application supports three log output formats:
Human-readable text format suitable for development and debugging.
docker run -v $(pwd)/reports:/reports -p 80:80 -e LOG_OUTPUT_FORMAT=text simple-krr-dashboardExample output:
2025-12-12 20:30:45,123 - simple_krr_dashboard.main - INFO - Starting application
2025-12-12 20:30:45,456 - simple_krr_dashboard.data - WARNING - No cluster name configured
Machine-readable key-value format, ideal for log aggregation systems like Grafana Loki.
docker run -v $(pwd)/reports:/reports -p 80:80 -e LOG_OUTPUT_FORMAT=logfmt simple-krr-dashboardExample output:
time=2025-12-12T20:30:45.123456 level=info logger=simple_krr_dashboard.main msg="Starting application"
time=2025-12-12T20:30:45.456789 level=warning logger=simple_krr_dashboard.data msg="No cluster name configured"
Structured JSON output, perfect for log parsing and analysis tools like ELK stack, Splunk, or cloud logging services.
docker run -v $(pwd)/reports:/reports -p 80:80 -e LOG_OUTPUT_FORMAT=json simple-krr-dashboardExample output:
{"time": "2025-12-12T20:30:45.123456", "level": "info", "logger": "simple_krr_dashboard.main", "message": "Starting application"}
{"time": "2025-12-12T20:30:45.456789", "level": "warning", "logger": "simple_krr_dashboard.data", "message": "No cluster name configured"}Disable HTTP access logs (recommended for production):
docker run -v $(pwd)/reports:/reports -p 80:80 -e DISABLE_HTTP_LOGS=true simple-krr-dashboardEnable HTTP access logs (useful for debugging):
docker run -v $(pwd)/reports:/reports -p 80:80 -e DISABLE_HTTP_LOGS=false simple-krr-dashboardChange application log level:
# Show only errors
docker run -v $(pwd)/reports:/reports -p 80:80 -e LOG_LEVEL=ERROR simple-krr-dashboard
# Show debug information
docker run -v $(pwd)/reports:/reports -p 80:80 -e LOG_LEVEL=DEBUG simple-krr-dashboardProduction-ready configuration with JSON logs:
docker run -v $(pwd)/reports:/reports -p 80:80 \
-e LOG_LEVEL=INFO \
-e LOG_OUTPUT_FORMAT=json \
-e DISABLE_HTTP_LOGS=true \
simple-krr-dashboardDevelopment configuration with detailed text logs:
docker run -v $(pwd)/reports:/reports -p 80:80 \
-e LOG_LEVEL=DEBUG \
-e LOG_OUTPUT_FORMAT=text \
-e DISABLE_HTTP_LOGS=false \
simple-krr-dashboardThe project uses pytest for testing. To run the tests:
-
Install test dependencies:
pipenv install --dev
-
Run the tests:
pipenv run pytest
-
Run tests with coverage report:
pipenv run pytest --cov=simple_krr_dashboard tests/
The tests are organized in the following structure:
tests/
├── __init__.py
├── conftest.py # Common test fixtures
├── test_app.py # Application tests
├── test_config.py # Configuration tests
├── test_dashboard.py # Dashboard component tests
├── test_data.py # Data processing tests
├── test_logging.py # Logging tests
└── test_utils.py # Utility function testsWhen adding new features, please include corresponding tests. The project follows these testing guidelines:
- Use pytest fixtures for common setup
- Mock external dependencies (e.g., file system, data processing)
- Test both success and error cases
- Include docstrings for test functions
- Use meaningful test names that describe the behavior being tested
Please read the CONTRIBUTING.md file for details on our code of conduct and the process for submitting pull requests.
Developed with ❤️ by @ialejandro and Cursor.com
