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 or sqlitepostgres
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.defaultZoneOptional fallback Electricity Maps zone; empty enables node-label discovery""
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.apiRateLimitPer-client, per-route API rate limit (e.g. 60/minute)60/minute
config.environmentRuntime environment; production requires API authenticationdevelopment
config.apiAuthModeAuthentication mode; api_key is the supported modeapi_key
config.rootPathURL prefix when the API is served behind a reverse proxy subpath""
ParameterDescriptionDefault
monitoring.serviceMonitor.enabledCreate a ServiceMonitor for Prometheus Operatorfalse
monitoring.serviceMonitor.namespaceNamespace for the ServiceMonitor (must match Prometheus selector)monitoring
monitoring.serviceMonitor.intervalScrape interval30s
monitoring.networkPolicy.enabledCreate a NetworkPolicy allowing Prometheus to reach GreenKubefalse
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.recommendations.recommendSystemNamespacesInclude system namespaces in recommendationsfalse
config.recommendations.vpaEnabledRead recommendation-mode VPAs; skip if the VPA CRD is absenttrue
config.recommendations.karpenterEnabledRead Karpenter NodePools; skip if Karpenter CRDs are absenttrue
config.recommendations.sourcePriorityRecommendation source precedence, highest firstvpa,karpenter,greenkube
config.recommendations.ttlDaysDays before an unapplied recommendation expires14
config.recommendations.verification.windowHoursPost-apply verification window72
config.recommendations.verification.minSavingsRatioMinimum measured savings as a fraction of the projection0.5
config.recommendations.verification.usageHeadroomMaximum p95 usage relative to the proposed request1.1
config.recommendations.verification.lifecycleIntervalApply-detection, verification, and expiry job interval5m
config.recommendations.git.providerGit provider for recommendation pull requests (github, gitlab, or gitea)github
config.recommendations.git.apiBaseUrlOptional API URL override for a self-hosted Git provider""
config.recommendations.git.defaultBranchFallback base branch for generated pull requestsmain
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.gitTokenGit personal access token for recommendation pull requests; empty disables PR automation""
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""

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.

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 size10Gi
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 or sqlitepostgres
DB_CONNECTION_STRINGPostgreSQL connection URL—
DB_PATHSQLite file pathgreenkube_data.db
PROMETHEUS_URLPrometheus server URLAuto-discovery
OPENCOST_API_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 zone; unknown lets GreenKube use node metadataunknown
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)""
API_AUTH_MODEAPI authentication mode; api_key is currently supportedapi_key
API_RATE_LIMITPer-client, per-route API rate limit (e.g. 60/minute)60/minute
ENVIRONMENTRuntime environment; production requires API authenticationdevelopment
ROOT_PATHURL prefix when served behind a reverse proxy subpath""
TRUSTED_PROXY_IPSComma-separated trusted proxy IPs/CIDRs for forwarded client addresses""
RIGHTSIZING_CPU_THRESHOLDCPU rightsizing threshold0.3
RIGHTSIZING_MEMORY_THRESHOLDMemory rightsizing threshold0.3
RIGHTSIZING_HEADROOMSafety multiplier for proposed resource requests1.2
ZOMBIE_COST_THRESHOLDZombie detection cost ($)0.01
ZOMBIE_ENERGY_THRESHOLDZombie detection energy threshold (J)1000
RECOMMENDATION_LOOKBACK_DAYSMetrics window used for recommendations7
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
RECOMMENDATION_VPA_ENABLEDEnable the VPA recommendation source; it skips when the CRD is absenttrue
RECOMMENDATION_KARPENTER_ENABLEDEnable Karpenter NodePool recommendations; they skip when CRDs are absenttrue
RECOMMENDATION_SOURCE_PRIORITYSource precedence for conflicting recommendationsvpa,karpenter,greenkube
RECOMMENDATION_TTL_DAYSDays before an unapplied recommendation expires14
VERIFICATION_WINDOW_HOURSPost-apply verification window72
VERIFICATION_MIN_SAVINGS_RATIOMinimum measured savings ratio to pass verification0.5
VERIFICATION_USAGE_HEADROOMp95 usage headroom used by the verification health gate1.1
RECOMMENDATION_LIFECYCLE_INTERVALApply-detection, verification, and expiry job interval5m
GIT_PROVIDERRecommendation pull request provider: github, gitlab, or giteagithub
GIT_API_BASE_URLOptional API URL override for a self-hosted Git provider—
GIT_DEFAULT_BRANCHFallback base branch for pull requestsmain
GIT_TOKENGit personal access token; empty disables PR automation—
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