-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[prometheus-rabbitmq-exporter] allow passing an external ConfigMap to override env vars #3582
Merged
monotek
merged 7 commits into
prometheus-community:main
from
davido912:feat/rabbitmq-exporter-external-configmap-override
Jul 20, 2023
Merged
[prometheus-rabbitmq-exporter] allow passing an external ConfigMap to override env vars #3582
monotek
merged 7 commits into
prometheus-community:main
from
davido912:feat/rabbitmq-exporter-external-configmap-override
Jul 20, 2023
Conversation
This file contains 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
Signed-off-by: David Ohayon <david.ohayon@traderepublic.com>
davido912
requested review from
desaintmartin,
Juanchimienti and
monotek
as code owners
July 11, 2023 15:30
@monotek perhaps you can assist in getting this through or checking this out, given you checked the previous PR :) |
zanhsieh
requested changes
Jul 17, 2023
Co-authored-by: MH <zanhsieh@gmail.com> Signed-off-by: David O <48397009+davido912@users.noreply.github.com>
Co-authored-by: MH <zanhsieh@gmail.com> Signed-off-by: David O <48397009+davido912@users.noreply.github.com>
@zanhsieh applied the changes |
zanhsieh
approved these changes
Jul 19, 2023
zanhsieh
approved these changes
Jul 19, 2023
Apparently we're missing one more review (@desaintmartin / @Juanchimienti / @monotek ) 🙌 |
monotek
approved these changes
Jul 20, 2023
monotek
approved these changes
Jul 20, 2023
Matiasmct
pushed a commit
to giffgaff/prometheus-charts-backup
that referenced
this pull request
Aug 25, 2023
… override env vars (prometheus-community#3582) * enable supplying an external configmap to override rmq exporter configs Signed-off-by: David Ohayon <david.ohayon@traderepublic.com> * Update charts/prometheus-rabbitmq-exporter/templates/configmap.yaml Co-authored-by: MH <zanhsieh@gmail.com> Signed-off-by: David O <48397009+davido912@users.noreply.github.com> * Update charts/prometheus-rabbitmq-exporter/templates/deployment.yaml Co-authored-by: MH <zanhsieh@gmail.com> Signed-off-by: David O <48397009+davido912@users.noreply.github.com> --------- Signed-off-by: David Ohayon <david.ohayon@traderepublic.com> Signed-off-by: David O <48397009+davido912@users.noreply.github.com> Co-authored-by: MH <zanhsieh@gmail.com>
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
Following #3574, I added a way to template the URL so that parent charts can template the URL into it without having to hardcode it. However, it appears subcharts don't read values from the parent chart.
Therefore, to allow for customisation of the envs vars, I moved all the env vars to a configmap and added the option to add an externally supplied configmap which will override whatever is in the first one.
According to the Kubernetes API reference, for envFrom:
"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated."
So the last overriding configmap which was added here will override, whereas anything in env will override everything in envFrom. Therefore, when for the password, when a secret is supplied, env takes precedence.
I hope this was clear and would appreciate feedback. Couldn't think of a better way to give some control back to the user.
Checklist
[prometheus-couchdb-exporter]
)