Configuration Reference
GreenKube follows the 12-Factor App methodology — all configuration is driven by environment variables. When deployed via Helm, these are set through values.yaml.
Helm Values Reference
Section titled “Helm Values Reference”| Parameter | Description | Default |
|---|---|---|
image.repository | Docker image repository | greenkube/greenkube |
config.logFormat | Log output format: json or console | json |
config.metricsListMaxRangeDays | Maximum date range (days) for GET /api/v1/metrics | 30 |
image.tag | Image tag | 0.3.0 |
image.pullPolicy | Image pull policy | IfNotPresent |
Database
Section titled “Database”| Parameter | Description | Default |
|---|---|---|
config.db.type | Storage backend: postgres or sqlite | postgres |
config.db.path | SQLite file path (if type is sqlite) | /data/greenkube_data.db |
config.db.schema | PostgreSQL schema | public |
Persistence (SQLite)
Section titled “Persistence (SQLite)”| Parameter | Description | Default |
|---|---|---|
config.persistence.enabled | Enable persistent storage for SQLite | false |
config.persistence.storageClassName | Storage class name (empty = default) | "" |
config.persistence.accessMode | PVC access mode | ReadWriteOnce |
config.persistence.size | PVC storage size | 1Gi |
Carbon & Energy
Section titled “Carbon & Energy”| Parameter | Description | Default |
|---|---|---|
config.cloudProvider | Cloud provider: aws, gcp, azure, ovh, scaleway, on-prem | unknown |
config.defaultZone | Optional fallback Electricity Maps zone; empty enables node-label discovery | "" |
config.defaultIntensity | Default grid intensity (gCO₂e/kWh) when API unavailable | 500.0 |
config.electricityProvider | Grid intensity data provider: electricity_maps or wattnet (EU-only, free — see Wattnet guide) | electricity_maps |
config.normalizationGranularity | Intensity lookup granularity: hour, day, none | hour |
config.defaults.pue | Power Usage Effectiveness factor | 1.3 |
config.defaults.instance.vcores | Default vCPU count for unknown instances | 1 |
config.defaults.instance.minWatts | Default min watts per vCPU | 1.0 |
config.defaults.instance.maxWatts | Default max watts per vCPU | 10.0 |
Prometheus
Section titled “Prometheus”| Parameter | Description | Default |
|---|---|---|
config.prometheus.url | Prometheus URL (empty = auto-discovery) | "" |
config.prometheus.verifyCerts | Verify TLS certificates | true |
config.prometheus.queryRangeStep | Range query step interval | 5m |
config.prometheus.queryRangeMaxSamples | Max data points per range query | 10000 |
config.prometheus.nodeInstanceLabel | Node label for instance type | label_node_kubernetes_io_instance_type |
OpenCost
Section titled “OpenCost”| Parameter | Description | Default |
|---|---|---|
config.opencost.url | OpenCost URL (empty = auto-discovery) | "" |
config.opencost.verifyCerts | Verify TLS certificates | true |
Node Analysis
Section titled “Node Analysis”| Parameter | Description | Default |
|---|---|---|
config.nodeAnalysisInterval | Interval for node analysis | 5m |
config.nodeDataMaxAgeDays | Max age for historical node data | 30 |
API Server
Section titled “API Server”| Parameter | Description | Default |
|---|---|---|
config.api.enabled | Enable the API server | true |
config.api.host | API listen address | 0.0.0.0 |
config.api.port | API listen port | 8000 |
config.corsOrigins | Allowed CORS origins (comma-separated) | * |
config.apiRateLimit | Per-client, per-route API rate limit (e.g. 60/minute) | 60/minute |
config.environment | Runtime environment; production requires API authentication | development |
config.apiAuthMode | Authentication mode; api_key is the supported mode | api_key |
config.rootPath | URL prefix when the API is served behind a reverse proxy subpath | "" |
Monitoring
Section titled “Monitoring”| Parameter | Description | Default |
|---|---|---|
monitoring.serviceMonitor.enabled | Create a ServiceMonitor for Prometheus Operator | false |
monitoring.serviceMonitor.namespace | Namespace for the ServiceMonitor (must match Prometheus selector) | monitoring |
monitoring.serviceMonitor.interval | Scrape interval | 30s |
monitoring.networkPolicy.enabled | Create a NetworkPolicy allowing Prometheus to reach GreenKube | false |
monitoring.networkPolicy.prometheusNamespace | Namespace where Prometheus runs | monitoring |
Recommendations
Section titled “Recommendations”| Parameter | Description | Default |
|---|---|---|
config.recommendations.lookbackDays | Days of data for analysis | 7 |
config.recommendations.rightsizingCpuThreshold | CPU usage ratio triggering rightsizing | 0.3 |
config.recommendations.rightsizingMemoryThreshold | Memory usage ratio triggering rightsizing | 0.3 |
config.recommendations.rightsizingHeadroom | Safety headroom multiplier | 1.2 |
config.recommendations.zombieCostThreshold | Cost threshold for zombie detection ($) | 0.01 |
config.recommendations.zombieEnergyThreshold | Energy threshold for zombie detection (J) | 1000 |
config.recommendations.autoscalingCvThreshold | CV threshold for autoscaling suggestion | 0.7 |
config.recommendations.autoscalingSpikeRatio | Max/avg ratio for spike detection | 3.0 |
config.recommendations.carbonAwareThreshold | Intensity ratio for carbon-aware scheduling | 1.5 |
config.recommendations.nodeUtilizationThreshold | Node utilization threshold | 0.2 |
config.recommendations.storageCostPerGibMonth | Fallback storage cost for orphaned PV savings when OpenCost has no data ($/GiB-month) | 0.10 |
config.recommendations.loadBalancerCostPerMonth | Fallback cost for orphaned LoadBalancer savings when OpenCost has no data ($/month) | 18.0 |
config.recommendations.recommendSystemNamespaces | Include system namespaces in recommendations | false |
config.recommendations.vpaEnabled | Read recommendation-mode VPAs; skip if the VPA CRD is absent | true |
config.recommendations.karpenterEnabled | Read Karpenter NodePools; skip if Karpenter CRDs are absent | true |
config.recommendations.sourcePriority | Recommendation source precedence, highest first | vpa,karpenter,greenkube |
config.recommendations.ttlDays | Days before an unapplied recommendation expires | 14 |
config.recommendations.verification.windowHours | Post-apply verification window | 72 |
config.recommendations.verification.minSavingsRatio | Minimum measured savings as a fraction of the projection | 0.5 |
config.recommendations.verification.usageHeadroom | Maximum p95 usage relative to the proposed request | 1.1 |
config.recommendations.verification.lifecycleInterval | Apply-detection, verification, and expiry job interval | 5m |
config.recommendations.git.provider | Git provider for recommendation pull requests (github, gitlab, or gitea) | github |
config.recommendations.git.apiBaseUrl | Optional API URL override for a self-hosted Git provider | "" |
config.recommendations.git.defaultBranch | Fallback base branch for generated pull requests | main |
Secrets
Section titled “Secrets”| Parameter | Description | Default |
|---|---|---|
secrets.electricityMapsToken | Electricity Maps API token | "" |
secrets.wattnetEmail | Wattnet account email (only when config.electricityProvider is wattnet) | "" |
secrets.wattnetPassword | Wattnet account password (only when config.electricityProvider is wattnet) | "" |
secrets.boaviztaToken | Boavizta API token | "" |
secrets.gitToken | Git personal access token for recommendation pull requests; empty disables PR automation | "" |
secrets.apiKey | Bearer token for API authentication (empty = no auth) | "" |
secrets.dbConnectionString | PostgreSQL connection string (only if not using bundled postgres) | "" |
secrets.prometheus.username | Prometheus basic auth username | "" |
secrets.prometheus.password | Prometheus basic auth password | "" |
secrets.prometheus.bearerToken | Prometheus bearer token | "" |
An empty API key permits open access in development. Set secrets.apiKey for protected API requests; production deployments require a non-empty key when config.apiAuthMode is api_key.
PostgreSQL (Bundled)
Section titled “PostgreSQL (Bundled)”| Parameter | Description | Default |
|---|---|---|
postgres.enabled | Deploy bundled PostgreSQL | true |
postgres.image.repository | PostgreSQL image | postgres |
postgres.image.tag | PostgreSQL version | 18-alpine |
postgres.auth.username | Database username | greenkube |
postgres.auth.password | Database password (auto-generated if empty) | "" |
postgres.auth.database | Database name | greenkube |
postgres.persistence.enabled | Enable persistent storage | true |
postgres.persistence.size | Storage size | 10Gi |
Resources
Section titled “Resources”| Parameter | Description | Default |
|---|---|---|
resources.requests.cpu | CPU request | 100m |
resources.requests.memory | Memory request | 128Mi |
resources.limits.cpu | CPU limit | 500m |
resources.limits.memory | Memory limit | 512Mi |
Environment Variables
Section titled “Environment Variables”When running outside Helm (Docker, source), use these environment variables:
| Variable | Description | Default |
|---|---|---|
DB_TYPE | postgres or sqlite | postgres |
DB_CONNECTION_STRING | PostgreSQL connection URL | — |
DB_PATH | SQLite file path | greenkube_data.db |
PROMETHEUS_URL | Prometheus server URL | Auto-discovery |
OPENCOST_API_URL | OpenCost server URL | Auto-discovery |
ELECTRICITY_MAPS_TOKEN | Electricity Maps API token | — |
ELECTRICITY_PROVIDER | Grid intensity provider: electricity_maps or wattnet | electricity_maps |
WATTNET_EMAIL | Wattnet account email (required when ELECTRICITY_PROVIDER=wattnet) | — |
WATTNET_PASSWORD | Wattnet account password (required when ELECTRICITY_PROVIDER=wattnet) | — |
BOAVIZTA_TOKEN | Boavizta API token | — |
CLOUD_PROVIDER | aws, gcp, azure, ovh, scaleway, on-prem | unknown |
DEFAULT_ZONE | Fallback carbon zone; unknown lets GreenKube use node metadata | unknown |
DEFAULT_INTENSITY | Fallback grid intensity (gCO₂e/kWh) | 500.0 |
DEFAULT_EMBODIED_EMISSIONS_KG | Fallback embodied emissions when Boavizta has no data | 100.0 |
DEFAULT_HARDWARE_LIFESPAN_YEARS | Cloud hardware lifespan assumption | 4 |
LOG_LEVEL | Logging level | INFO |
NORMALIZATION_GRANULARITY | hour, day, none | hour |
PROMETHEUS_QUERY_RANGE_STEP | Range query step | 5m |
API_HOST | API listen address | 0.0.0.0 |
API_PORT | API listen port | 8000 |
LOG_FORMAT | Log output format: json (structured, Loki-ready) or console (human-readable) | json |
METRICS_LIST_MAX_RANGE_DAYS | Maximum date range (days) allowed for GET /api/v1/metrics raw listing; requests wider than this return HTTP 400 | 30 |
GREENKUBE_API_KEY | Bearer token for API authentication (empty = no auth) | — |
CORS_ORIGINS | Allowed CORS origins (comma-separated) | "" |
API_AUTH_MODE | API authentication mode; api_key is currently supported | api_key |
API_RATE_LIMIT | Per-client, per-route API rate limit (e.g. 60/minute) | 60/minute |
ENVIRONMENT | Runtime environment; production requires API authentication | development |
ROOT_PATH | URL prefix when served behind a reverse proxy subpath | "" |
TRUSTED_PROXY_IPS | Comma-separated trusted proxy IPs/CIDRs for forwarded client addresses | "" |
RIGHTSIZING_CPU_THRESHOLD | CPU rightsizing threshold | 0.3 |
RIGHTSIZING_MEMORY_THRESHOLD | Memory rightsizing threshold | 0.3 |
RIGHTSIZING_HEADROOM | Safety multiplier for proposed resource requests | 1.2 |
ZOMBIE_COST_THRESHOLD | Zombie detection cost ($) | 0.01 |
ZOMBIE_ENERGY_THRESHOLD | Zombie detection energy threshold (J) | 1000 |
RECOMMENDATION_LOOKBACK_DAYS | Metrics window used for recommendations | 7 |
METRICS_RAW_RETENTION_DAYS | Days to keep 5-min raw metrics | 7 |
METRICS_AGGREGATED_RETENTION_DAYS | Days to keep hourly aggregates (-1 = infinite) | -1 |
METRICS_COMPRESSION_AGE_HOURS | Age after which raw metrics are compressed | 24 |
DB_POOL_MIN_SIZE | PostgreSQL min connection pool size | 1 |
DB_POOL_MAX_SIZE | PostgreSQL max connection pool size | 10 |
DB_STATEMENT_TIMEOUT_MS | PostgreSQL per-statement timeout (ms) | 30000 |
RECOMMENDATION_VPA_ENABLED | Enable the VPA recommendation source; it skips when the CRD is absent | true |
RECOMMENDATION_KARPENTER_ENABLED | Enable Karpenter NodePool recommendations; they skip when CRDs are absent | true |
RECOMMENDATION_SOURCE_PRIORITY | Source precedence for conflicting recommendations | vpa,karpenter,greenkube |
RECOMMENDATION_TTL_DAYS | Days before an unapplied recommendation expires | 14 |
VERIFICATION_WINDOW_HOURS | Post-apply verification window | 72 |
VERIFICATION_MIN_SAVINGS_RATIO | Minimum measured savings ratio to pass verification | 0.5 |
VERIFICATION_USAGE_HEADROOM | p95 usage headroom used by the verification health gate | 1.1 |
RECOMMENDATION_LIFECYCLE_INTERVAL | Apply-detection, verification, and expiry job interval | 5m |
GIT_PROVIDER | Recommendation pull request provider: github, gitlab, or gitea | github |
GIT_API_BASE_URL | Optional API URL override for a self-hosted Git provider | — |
GIT_DEFAULT_BRANCH | Fallback base branch for pull requests | main |
GIT_TOKEN | Git personal access token; empty disables PR automation | — |
STORAGE_COST_PER_GIB_MONTH | Fallback cost for orphaned PV recommendations ($/GiB-month) | 0.10 |
LOAD_BALANCER_COST_PER_MONTH | Fallback cost for orphaned LoadBalancer recommendations ($/month) | 18.0 |