-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
operator: Fix storing authentication credentials in the Loki ConfigMap #11357
operator: Fix storing authentication credentials in the Loki ConfigMap #11357
Conversation
Trivy scan found the following vulnerabilities:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Only tested it with S3 so far. Found a few typos, see comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While testing today something occurred to me, that I did not think of yesterday:
This change makes the configuration file static with regards to some of the fields of the secret (the ones that are passed using environment variables now).
We currently pass an annotation containing the hash of the configuration file to all the deployments / statefulsets that we create, so that they automatically re-create their pods when the configuration changes. Because some fields of the secret now do not correspond to a change in the configuration file it can happen that a change to the secret does not trigger an update of the deployments/statefulsets anymore causing old configuration to persist in the Loki instances.
I guess a simple fix for this would be to take the contents of the secret into account when creating the "config-hash" as well. Adding a new annotation is also an alternative.
Co-authored-by: Robert Jacob <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pod updates seem to work fine now 👍
One refactoring idea in the comments, looks fine for me otherwise.
grafana#11357) Co-authored-by: Robert Jacob <[email protected]> Co-authored-by: Robert Jacob <[email protected]>
grafana#11357) Co-authored-by: Robert Jacob <[email protected]> Co-authored-by: Robert Jacob <[email protected]>
grafana#11357) Co-authored-by: Robert Jacob <[email protected]> Co-authored-by: Robert Jacob <[email protected]>
[release-5.8] Backport PR grafana#11357
[release-5.7] Backport PR grafana#11357
[release-5.6] Backport PR grafana#11357
grafana#11357) Co-authored-by: Robert Jacob <[email protected]> Co-authored-by: Robert Jacob <[email protected]>
What this PR does / why we need it:
The following PR replaces all sensitive authentication information from the Loki configuration file by reading values from environment variables. Latter are projected from the object storage secret via
EnvVar.ValueFrom
source declaration.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)CHANGELOG.md
updatedadd-to-release-notes
labeldocs/sources/setup/upgrade/_index.md
production/helm/loki/Chart.yaml
and updateproduction/helm/loki/CHANGELOG.md
andproduction/helm/loki/README.md
. Example PRdeprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR