Skip to content
GreenKube

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.

ParameterDescriptionDefault
image.repositoryDocker image repositorygreenkube/greenkube
config.logFormatLog output format: json or consolejson
config.metricsListMaxRangeDaysMaximum date range (days) for GET /api/v1/metrics30
image.tagImage tag0.3.0
image.pullPolicyImage pull policyIfNotPresent
ParameterDescriptionDefault
config.db.typeStorage backend: postgres, sqlite, elasticsearchpostgres
config.db.pathSQLite file path (if type is sqlite)/data/greenkube_data.db
config.db.schemaPostgreSQL schemapublic
ParameterDescriptionDefault
config.persistence.enabledEnable persistent storage for SQLitefalse
config.persistence.storageClassNameStorage class name (empty = default)""
config.persistence.accessModePVC access modeReadWriteOnce
config.persistence.sizePVC storage size1Gi
ParameterDescriptionDefault
config.cloudProviderCloud provider: aws, gcp, azure, ovh, scaleway, on-premunknown
config.defaultZoneFallback carbon zone (ISO country code)FR
config.defaultIntensityDefault grid intensity (gCO₂e/kWh) when API unavailable500.0
config.electricityProviderGrid intensity data provider: electricity_maps or wattnet (EU-only, free — see Wattnet guide)electricity_maps
config.normalizationGranularityIntensity lookup granularity: hour, day, nonehour
config.defaults.puePower Usage Effectiveness factor1.3
config.defaults.instance.vcoresDefault vCPU count for unknown instances1
config.defaults.instance.minWattsDefault min watts per vCPU1.0
config.defaults.instance.maxWattsDefault max watts per vCPU10.0
ParameterDescriptionDefault
config.prometheus.urlPrometheus URL (empty = auto-discovery)""
config.prometheus.verifyCertsVerify TLS certificatestrue
config.prometheus.queryRangeStepRange query step interval5m
config.prometheus.queryRangeMaxSamplesMax data points per range query10000
config.prometheus.nodeInstanceLabelNode label for instance typelabel_node_kubernetes_io_instance_type
ParameterDescriptionDefault
config.opencost.urlOpenCost URL (empty = auto-discovery)""
config.opencost.verifyCertsVerify TLS certificatestrue
ParameterDescriptionDefault
config.nodeAnalysisIntervalInterval for node analysis5m
config.nodeDataMaxAgeDaysMax age for historical node data30
ParameterDescriptionDefault
config.api.enabledEnable the API servertrue
config.api.hostAPI listen address0.0.0.0
config.api.portAPI listen port8000
config.corsOriginsAllowed CORS origins (comma-separated)*
config.apiRateLimitRate limit for API endpoints (slowapi format)60/minute
ParameterDescriptionDefault
monitoring.serviceMonitor.enabledCreate a ServiceMonitor for Prometheus Operatortrue
monitoring.serviceMonitor.namespaceNamespace for the ServiceMonitor (must match Prometheus selector)monitoring
monitoring.serviceMonitor.intervalScrape interval30s
monitoring.networkPolicy.enabledCreate a NetworkPolicy allowing Prometheus to reach GreenKubetrue
monitoring.networkPolicy.prometheusNamespaceNamespace where Prometheus runsmonitoring
ParameterDescriptionDefault
config.recommendations.lookbackDaysDays of data for analysis7
config.recommendations.rightsizingCpuThresholdCPU usage ratio triggering rightsizing0.3
config.recommendations.rightsizingMemoryThresholdMemory usage ratio triggering rightsizing0.3
config.recommendations.rightsizingHeadroomSafety headroom multiplier1.2
config.recommendations.zombieCostThresholdCost threshold for zombie detection ($)0.01
config.recommendations.zombieEnergyThresholdEnergy threshold for zombie detection (J)1000
config.recommendations.autoscalingCvThresholdCV threshold for autoscaling suggestion0.7
config.recommendations.autoscalingSpikeRatioMax/avg ratio for spike detection3.0
config.recommendations.carbonAwareThresholdIntensity ratio for carbon-aware scheduling1.5
config.recommendations.nodeUtilizationThresholdNode utilization threshold0.2
config.recommendations.storageCostPerGibMonthFallback storage cost for orphaned PV savings when OpenCost has no data ($/GiB-month)0.10
config.recommendations.loadBalancerCostPerMonthFallback cost for orphaned LoadBalancer savings when OpenCost has no data ($/month)18.0
config.recommendSystemNamespacesInclude system namespaces in recommendationsfalse
ParameterDescriptionDefault
secrets.electricityMapsTokenElectricity Maps API token""
secrets.wattnetEmailWattnet account email (only when config.electricityProvider is wattnet)""
secrets.wattnetPasswordWattnet account password (only when config.electricityProvider is wattnet)""
secrets.boaviztaTokenBoavizta API token""
secrets.apiKeyBearer token for API authentication (empty = no auth)""
secrets.dbConnectionStringPostgreSQL connection string (only if not using bundled postgres)""
secrets.prometheus.usernamePrometheus basic auth username""
secrets.prometheus.passwordPrometheus basic auth password""
secrets.prometheus.bearerTokenPrometheus bearer token""
ParameterDescriptionDefault
postgres.enabledDeploy bundled PostgreSQLtrue
postgres.image.repositoryPostgreSQL imagepostgres
postgres.image.tagPostgreSQL version18-alpine
postgres.auth.usernameDatabase usernamegreenkube
postgres.auth.passwordDatabase password (auto-generated if empty)""
postgres.auth.databaseDatabase namegreenkube
postgres.persistence.enabledEnable persistent storagetrue
postgres.persistence.sizeStorage size1Gi
ParameterDescriptionDefault
resources.requests.cpuCPU request100m
resources.requests.memoryMemory request128Mi
resources.limits.cpuCPU limit500m
resources.limits.memoryMemory limit512Mi

When running outside Helm (Docker, source), use these environment variables:

VariableDescriptionDefault
DB_TYPEpostgres, sqlite, elasticsearchpostgres
DB_CONNECTION_STRINGPostgreSQL connection URL
DB_PATHSQLite file path/data/greenkube_data.db
ELASTICSEARCH_HOSTSElasticsearch endpoint(s)
PROMETHEUS_URLPrometheus server URLAuto-discovery
OPENCOST_URLOpenCost server URLAuto-discovery
ELECTRICITY_MAPS_TOKENElectricity Maps API token
ELECTRICITY_PROVIDERGrid intensity provider: electricity_maps or wattnetelectricity_maps
WATTNET_EMAILWattnet account email (required when ELECTRICITY_PROVIDER=wattnet)
WATTNET_PASSWORDWattnet account password (required when ELECTRICITY_PROVIDER=wattnet)
BOAVIZTA_TOKENBoavizta API token
CLOUD_PROVIDERaws, gcp, azure, ovh, scaleway, on-premunknown
DEFAULT_ZONEFallback carbon zoneFR
DEFAULT_INTENSITYFallback grid intensity (gCO₂e/kWh)500.0
DEFAULT_EMBODIED_EMISSIONS_KGFallback embodied emissions when Boavizta has no data100.0
DEFAULT_HARDWARE_LIFESPAN_YEARSCloud hardware lifespan assumption4
LOG_LEVELLogging levelINFO
NORMALIZATION_GRANULARITYhour, day, nonehour
PROMETHEUS_QUERY_RANGE_STEPRange query step5m
API_HOSTAPI listen address0.0.0.0
API_PORTAPI listen port8000
LOG_FORMATLog output format: json (structured, Loki-ready) or console (human-readable)json
METRICS_LIST_MAX_RANGE_DAYSMaximum date range (days) allowed for GET /api/v1/metrics raw listing; requests wider than this return HTTP 40030
GREENKUBE_API_KEYBearer token for API authentication (empty = no auth)
CORS_ORIGINSAllowed CORS origins (comma-separated)*
RIGHTSIZING_CPU_THRESHOLDCPU rightsizing threshold0.5
ZOMBIE_COST_THRESHOLDZombie detection cost ($)0.01
METRICS_RAW_RETENTION_DAYSDays to keep 5-min raw metrics7
METRICS_AGGREGATED_RETENTION_DAYSDays to keep hourly aggregates (-1 = infinite)-1
METRICS_COMPRESSION_AGE_HOURSAge after which raw metrics are compressed24
DB_POOL_MIN_SIZEPostgreSQL min connection pool size1
DB_POOL_MAX_SIZEPostgreSQL max connection pool size10
DB_STATEMENT_TIMEOUT_MSPostgreSQL per-statement timeout (ms)30000
TRUST_AUTH_PROXYRead the authenticated user from X-Forwarded-User/X-Auth-Request-User headers instead of GreenKube’s own auth (for use behind Authentik, Caddy forward_auth, etc.)false
STORAGE_COST_PER_GIB_MONTHFallback cost for orphaned PV recommendations ($/GiB-month)0.10
LOAD_BALANCER_COST_PER_MONTHFallback cost for orphaned LoadBalancer recommendations ($/month)18.0