-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat(redis): Secrets credentials via volume mount #24597
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
base: master
Are you sure you want to change the base?
Conversation
❌ Preview Environment undeployed from BunnyshellAvailable commands (reply to this comment):
|
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 19f73c4)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 56fdbba)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 6faea33)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit f078ccc)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 0730071)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit d8cb701)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 60055d0)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 11da147)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 9ae4d23)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 01bdb19)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 8aa326f)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 6f58117)
…le mount Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 3f2e7e8)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit a7962a2)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 5510ccb)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit 8512dd8)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit f2338ee)
Signed-off-by: Mangaal <[email protected]> (cherry picked from commit c11e2f0)
Signed-off-by: Mangaal <[email protected]>
Signed-off-by: Mangaal <[email protected]>
- Remove duplicate volumeMounts section Signed-off-by: Mangaal <[email protected]>
Signed-off-by: Mangaal <[email protected]>
Signed-off-by: Mangaal <[email protected]>
Signed-off-by: Mangaal <[email protected]>
115d9b6 to
2026e39
Compare
Signed-off-by: Mangaal <[email protected]>
|
Hi @dudinea , I have updated this PR to include only the required code changes for this feature. I will create a separate PR for the documentation and manifest updates. |
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.
Hi @Mangaal! Thank you for the changes you made to the PR!
This PR has been discussed on the last Contributors Experience Meeting: it has been decided to include this functionality for now without the changes in the provided Manifests, just argocd code + docs to allow interested people to use this functionality provided they know to add custom configuration to ArgoCD and Redis.
Could you re-add the relevant part of the FAQ that you wrote?
Please also see my new comment on the code.
After this is addressed I hope it would be possible to commit this feature.
Signed-off-by: Mangaal <[email protected]>
…ets-via-volume-mount-clean
|
Hi @dudinea, I have added documentation explaining how to configure Argo CD components with file-based Redis authentication and have also addressed your previous review 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.
Hi! Please see the comments on the files. Otherwise LGTM.
Thanks!
…ets-via-volume-mount-clean
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.
Thank you! I've left some comments, PTAL.
| The Redis password is stored in Kubernetes secret `argocd-redis` with key `auth` in the namespace where Argo CD is installed. | ||
| You can config your secret provider to generate Kubernetes secret accordingly. | ||
|
|
||
| ### Using file-based Redis credentials via `REDIS_CREDS_FILE_PATH` |
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.
Also, i think we should find a better place to document somewhere, probably in operator-manual?
Signed-off-by: Mangaal <[email protected]>
…ets-via-volume-mount-clean
Signed-off-by: Mangaal <[email protected]>
…ets-via-volume-mount-clean
|
Hi @dudinea, could you please take a look at my PR when you have a chance? |
|
Feel free to resolve the comments that you've addressed. |
…ets-via-volume-mount-clean
Description
This PR introduces a more secure method for providing Redis credentials to Argo CD components by allowing them to be loaded from a specified file path. Currently, Redis credentials (password, username, sentinel credentials) are configured via environment variables (e.g., REDIS_PASSWORD). Storing secrets in environment variables is a common practice but can be less secure than using file-based secrets.
This change is backward-compatible. Existing setups using environment variables will continue to work without any modification
Proposed Change
This PR introduces a new mechanism to load Redis credentials from files:
REDIS_CREDS_FILE_PATH, is introduced. This variable should point to a directory where credential files are mounted.REDIS_CREDS_FILE_PATHis set, Argo CD will attempt to read credentials from the following files within that directory:auth: The password for the main Redis connection.auth_username: The username for the main Redis connection.sentinel_auth: The password for Redis Sentinel connections.sentinel_username: The username for Redis Sentinel connections.REDIS_CREDS_FILE_PATHis not set, or if a specific credential file does not exist, the system gracefully falls back to using the corresponding environment variables (REDIS_PASSWORD,REDIS_USERNAME, etc.). This ensures full backward compatibility.Implementation Details
REDIS_CREDS_FILE_PATHenvironment variable. If present, it calls loadRedisCredsFromFile and then checks if any credentials still need to be populated from the environment variables.How to Test This Change
Mount the Secret into your Argo CD pods (e.g., argocd-repo-server, argocd-application-controller) and set the new environment variable.
Related Issue
Fixes #20619