feat: add opencost.exporter.extraEnvFrom to source env from ConfigMap/Secret - #378
Open
ahauserv wants to merge 1 commit into
Open
feat: add opencost.exporter.extraEnvFrom to source env from ConfigMap/Secret#378ahauserv wants to merge 1 commit into
ahauserv wants to merge 1 commit into
Conversation
The exporter container renders extraEnv as literal name/value pairs only, so an env var whose value is not known when the values file is written cannot be supplied. clusterIdConfigmap already works around this for CLUSTER_ID specifically; generalise that escape hatch by rendering an envFrom list from the new opencost.exporter.extraEnvFrom value, letting any exporter env var come from a ConfigMap or Secret. Value name and rendering follow the convention used by the promtail and loki charts. The envFrom block sits after env: to keep precedence semantics obvious; explicit env entries win over envFrom in Kubernetes regardless of order. Only the exporter is changed: ui.extraEnv and sigV4Proxy.extraEnv are list-shaped and already accept valueFrom. The README table row and version badge are updated in place; a full helm-docs run also picks up unrelated drift from the v1.121.1 release and is left to the publish workflow. Signed-off-by: ahauser <andreas.hauser@vector.com>
ahauserv
force-pushed
the
exporter-extra-env-from
branch
from
August 7, 2026 15:20
02cafa8 to
a2b63b2
Compare
Author
|
@ameijer a small change that would make it possible to set ENVs from a secret/configmap. The workflow is waiting for an approval. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
opencost.exporter.extraEnvonly renders literal name/value pairs, so an exporter env var whose value is not known when the values file is written cannot be supplied.Typical case: values that are only known in the cluster at deploy time, or values that belong in a Secret rather than in chart values.
Explicit
env:entries win overenvFromin Kubernetes, so everything the chart sets explicitly (includingextraEnv) keeps precedence.Chart version bumped to 2.5.30; README table row and version badge updated accordingly.
How was this tested
helm templatewith the values above renders on the exporter container:With the value unset, no
envFromis rendered (unchanged output).helm lintandhelm unittest charts/opencost -f 'tests/plugins_test.yaml'pass.