[consul-exporter] Support using environment variables in command args#6897
Open
javajawa wants to merge 1 commit into
Open
[consul-exporter] Support using environment variables in command args#6897javajawa wants to merge 1 commit into
javajawa wants to merge 1 commit into
Conversation
To increase the flexibility for options and arguments in the chart, this change adds a flag `invokeViaShell` to the values. When enabled the `consul_exporter` is not directly executed by kubernetes. Instead the same command is passed to `/bin/sh`, which will replace any environment variables. This allows users to pull in options from secrets on the cluster; kubernetes's downwardApi systems; or other environment ephemera. The option is disabled by default. Fixes: prometheus-community#6896 Signed-off-by: Benedict Harcourt <benedict.harcourt@futurenet.com>
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.
What this PR does / why we need it
To increase the flexibility for options and arguments in the chart, this change adds a flag
invokeViaShellto the values. When enabled theconsul_exporteris not directly executed by kubernetes. Instead the same command is passed to/bin/sh, which will replace any environment variables.This allows users to pull in options from secrets on the cluster; kubernetes's downwardApi systems; or other environment ephemera. The option is disabled by default.
This allows for constructs such as
Which issue this PR fixes
Special notes for your reviewer
This change goes slightly against typical helm conventions of having values for
commandandargswhich can be overridden by the user.As we have a always present argument specified by
consulServer, I felt that building up the logic for a more generic solution would overall increase the complexity/confusion for this chart.Checklist
[prometheus-couchdb-exporter])