Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .env.docker.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# ==================== KRR Docker Configuration ====================
# Copy this file to .env and customize the values

# ==================== Docker Image ====================
# Local image (will build if not exists):
KRR_DOCKER_IMAGE=krr:latest
# Or use image from Artifact Registry:
# KRR_DOCKER_IMAGE=europe-west12-docker.pkg.dev/formazione-ion-boleac/tools/holo-krr:latest
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor

Replace real infrastructure path with a generic placeholder.

This line contains what appears to be a real internal Artifact Registry path (formazione-ion-boleac project). Example files should not include real infrastructure details, even when commented out, to avoid information disclosure and user confusion.

πŸ”’ Proposed fix to use a generic placeholder
-# KRR_DOCKER_IMAGE=europe-west12-docker.pkg.dev/formazione-ion-boleac/tools/holo-krr:latest
+# KRR_DOCKER_IMAGE=your-region-docker.pkg.dev/your-project/your-repo/krr:latest
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# KRR_DOCKER_IMAGE=europe-west12-docker.pkg.dev/formazione-ion-boleac/tools/holo-krr:latest
# KRR_DOCKER_IMAGE=your-region-docker.pkg.dev/your-project/your-repo/krr:latest
πŸ€– Prompt for AI Agents
In @.env.docker.example at line 8, Replace the real Artifact Registry path in
the example environment variable with a generic placeholder: update the
commented KRR_DOCKER_IMAGE line so it no longer contains
"europe-west12-docker.pkg.dev/formazione-ion-boleac/..." and instead uses a
neutral value like "<REPO_HOST>/<PROJECT>/<IMAGE>:<TAG>" or
"your-registry/your-project/your-image:latest"; ensure the variable name
KRR_DOCKER_IMAGE remains unchanged so examples and docs still show the expected
key.


# ==================== Strategy Selection ====================
# Options: simple, simple-limit, ai-assisted
KRR_STRATEGY=simple

# ==================== Kubernetes Settings ====================
# KRR_KUBECONFIG=/path/to/kubeconfig
# KRR_AS=system:serviceaccount:default:krr-account
# KRR_AS_GROUP=system:authenticated
# KRR_CONTEXT=my-cluster-context
# KRR_ALL_CLUSTERS=false
KRR_NAMESPACE=default
# KRR_RESOURCE=Deployment,StatefulSet
# KRR_SELECTOR=app=myapp,env=prod

# ==================== Prometheus Settings ====================
KRR_PROMETHEUS_URL=https://monitoring.googleapis.com/v1/projects/my-project/location/global/prometheus
# KRR_PROMETHEUS_AUTH_HEADER=Bearer YOUR_TOKEN_HERE
# KRR_PROMETHEUS_HEADERS=X-Custom-Header: value
# KRR_PROMETHEUS_SSL_ENABLED=true
KRR_PROMETHEUS_CLUSTER_LABEL=my-cluster-name
KRR_PROMETHEUS_LABEL=cluster_name

# ==================== Prometheus EKS Settings ====================
# KRR_EKS_MANAGED_PROM=false
# KRR_EKS_PROFILE_NAME=default
# KRR_EKS_ACCESS_KEY=YOUR_ACCESS_KEY
# KRR_EKS_SECRET_KEY=YOUR_SECRET_KEY
# KRR_EKS_SERVICE_NAME=aps
# KRR_EKS_MANAGED_PROM_REGION=us-east-1
# KRR_EKS_ASSUME_ROLE=arn:aws:iam::123456789012:role/MyRole

# ==================== Prometheus Coralogix Settings ====================
# KRR_CORALOGIX_TOKEN=YOUR_CORALOGIX_TOKEN

# ==================== Prometheus Openshift Settings ====================
# KRR_OPENSHIFT=false

# ==================== Prometheus GCP Settings ====================
# KRR_GCP_ANTHOS=false

# ==================== Recommendation Settings ====================
KRR_CPU_MIN=10
KRR_MEM_MIN=100

# ==================== Threading Settings ====================
KRR_MAX_WORKERS=1

# ==================== Job Grouping Settings ====================
# KRR_JOB_GROUPING_LABELS=app,team
# KRR_JOB_GROUPING_LIMIT=500

# ==================== Job Discovery Settings ====================
# KRR_DISCOVERY_JOB_BATCH_SIZE=5000
# KRR_DISCOVERY_JOB_MAX_BATCHES=100

# ==================== Logging Settings ====================
KRR_FORMATTER=table
# KRR_VERBOSE=false
# KRR_QUIET=false
# KRR_LOGTOSTDERR=false
# KRR_WIDTH=120

# ==================== Output Settings ====================
# KRR_SHOW_CLUSTER_NAME=false
# KRR_EXCLUDE_SEVERITY=true
# KRR_FILEOUTPUT=/output/report.csv
KRR_FILEOUTPUT_DYNAMIC=true
# KRR_SLACKOUTPUT=#my-channel
# KRR_SLACKTITLE=KRR Report
# KRR_AZUREBLOBOUTPUT=https://mystorageaccount.blob.core.windows.net/container?sv=...
# KRR_TEAMS_WEBHOOK=https://outlook.office.com/webhook/...
# KRR_AZURE_SUBSCRIPTION_ID=your-subscription-id
# KRR_AZURE_RESOURCE_GROUP=your-resource-group

# ==================== Publish Scan Settings to a Robusta Runner ====================
# KRR_PUBLISH_SCAN_URL=https://api.example.com/scans
# KRR_START_TIME=2024-01-01T00:00:00Z
# KRR_SCAN_ID=uuid-here
# KRR_NAMED_SINKS=sink1,sink2

# ==================== Strategy Settings (Common) ====================
KRR_HISTORY_DURATION=48
KRR_TIMEFRAME_DURATION=5.0
KRR_POINTS_REQUIRED=100
KRR_ALLOW_HPA=false
KRR_USE_OOMKILL_DATA=true

# ==================== Strategy: simple ====================
KRR_CPU_PERCENTILE=95
KRR_MEMORY_BUFFER_PERCENTAGE=15
# KRR_OOM_MEMORY_BUFFER_PERCENTAGE=25

# ==================== Strategy: simple-limit ====================
# KRR_CPU_REQUEST=66
# KRR_CPU_LIMIT=96

# ==================== Strategy: ai-assisted ====================
# KRR_AI_PROVIDER=gemini
# KRR_AI_MODEL=gemini-3-flash-preview
# KRR_AI_API_KEY=YOUR_AI_API_KEY
# KRR_AI_TEMPERATURE=0.3
# KRR_AI_MAX_TOKENS=5000
# KRR_AI_COMPACT_MODE=false
# KRR_AI_EXCLUDE_SIMPLE_REFERENCE=false
# KRR_AI_TIMEOUT=60

# ==================== External API Keys (alternative to flags) ====================
# OPENAI_API_KEY=your-openai-key
# GEMINI_API_KEY=your-gemini-key
# ANTHROPIC_API_KEY=your-anthropic-key
# SLACK_BOT_TOKEN=xoxb-your-slack-token
88 changes: 88 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# ==================== GCP Configuration ====================
# GCP Project ID
PROJECT_ID="your-project-id"

# Kubernetes Cluster Name
CLUSTER_NAME="your-cluster-name"

# Use Anthos on-prem or GKE cloud
# Set to "anthos" for Anthos on-prem, leave empty "" for GKE cloud
USE_ANTHOS="anthos"

# Kubernetes context name
# For Anthos: connectgateway_PROJECT_ID_global_CLUSTER_NAME
# For GKE: gke_PROJECT_ID_REGION_CLUSTER_NAME
CONTEXT="connectgateway_your-project_global_your-cluster"

# Optional: Specific namespace (if not provided, uses 'default' or passed as argument)
# NAMESPACE="default"

# ==================== Docker Image Configuration ====================
# Docker image to use (local or remote from Artifact Registry)
# Local image:
# KRR_DOCKER_IMAGE="krr:latest"
# Remote image from Artifact Registry (multi-platform):
KRR_DOCKER_IMAGE="europe-west12-docker.pkg.dev/your-project/tools/holo-krr:latest"

# ==================== KRR Analysis Parameters ====================
# CPU percentile for recommendations (default: 95)
CPU_PERCENTILE="90"

# History duration in hours (default: 48)
HISTORY_DURATION="230"

# Timeframe duration in minutes (default: 5.0)
TIMEFRAME_DURATION="2.0"

# Memory buffer percentage (default: 15)
MEMORY_BUFFER_PERCENTAGE="15"

# Maximum workers for parallel processing (default: 1)
MAX_WORKERS="1"

# Use OOMKill data for memory recommendations (default: true)
USE_OOMKILL_DATA="true"

# Output formatter: table, json, csv, yaml (default: table)
FORMATTER="table"

# Enable dynamic file output naming (default: true)
FILEOUTPUT_DYNAMIC="true"

# ==================== AI Settings ====================
# Enable AI-assisted strategy (default: false)
# When true, uses ai-assisted strategy; when false, uses simple strategy
AI_MODE="true"

# AI model to use (default: gemini-3-flash-preview)
AI_MODEL="gemini-3-flash-preview"

# Gemini API Key (required if AI_MODE=true)
GEMINI_API_KEY="your-gemini-api-key-here"

# AI max tokens for response (default: 3000)
# AI_MAX_TOKENS="5000"

# ==================== HPA Mode ====================
# Analyze workloads with HPA (Horizontal Pod Autoscaler) configured
# Default: false (skip HPA workloads)
HPA_MODE="true"

# ==================== Optional Settings ====================
# Owner batch size for reducing queries (useful to avoid rate limiting)
# OWNER_BATCH_SIZE="200"

# ==================== Alternative Cluster Examples ====================
# Example 1: GKE Autopilot
# PROJECT_ID="sicraweb-evo-dev"
# CLUSTER_NAME="autopilot-cluster-sicra-dev"
# USE_ANTHOS=""
# CONTEXT="gke_sicraweb-evo-dev_europe-west8_autopilot-cluster-sicra-dev"
# NAMESPACE="cartellini"

# Example 2: GKE Standard
# PROJECT_ID="icarocloud-prod"
# CLUSTER_NAME="cluster-icaro-prod"
# USE_ANTHOS=""
# CONTEXT="gke_icarocloud-prod_europe-west8_cluster-icaro-prod"
# NAMESPACE="icaro"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
__pycache__/
*.py[cod]
*$py.class
/examples/algorithm_demos/**
**/*.table
**/krr-*

# C extensions
*.so
Expand Down
Loading