Repository navigation
[Bug] Propagate Redis password to KubernetesJob batch worker - #2366
Merged
varungup90 merged 2 commits intoJun 23, 2026
Merged
varungup90 merged 2 commits into
varungup90 merged 2 commits into
Conversation
Signed-off-by: Varshith <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for injecting the Redis password into the worker's environment variables via a Kubernetes Secret reference when WORKER_REDIS_PASSWORD_SECRET_NAME and WORKER_REDIS_PASSWORD_SECRET_KEY are provided. It also adds corresponding unit tests to verify this behavior. The review feedback suggests adding warning logs for misconfigurations—such as when only one of the secret environment variables is set, or when STORAGE_REDIS_PASSWORD is configured but the secret variables are missing—to prevent silent authentication failures and improve debuggability.
Signed-off-by: Varshith <[email protected]>
varungup90
approved these changes
Jun 23, 2026
3 tasks
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.
Pull Request Description
In
KubernetesJob(self-hosting) mode the batch worker runs its own metastore I/O and inherits the metadata service's Redis configuration frombuild_metastore_env()inaibrix/batch/manifest/storage_env.py._redis_env()emittedREDIS_HOST,REDIS_PORT, andREDIS_DBonly, omitting the password. On a Redis that requires authentication the worker connected unauthenticated and metastore I/O failed, so the batch produced no results. TheKubernetes(Deployment) path is unaffected, since it does its I/O in the metadata process._redis_env()now appends aREDIS_PASSWORDenv sourced fromvalueFrom.secretKeyRefwhen bothWORKER_REDIS_PASSWORD_SECRET_NAMEandWORKER_REDIS_PASSWORD_SECRET_KEYare set, mirroring the existingWORKER_REDIS_HOSToverride. The password is delivered through a Secret, never a literal pod-spec value. The worker reads it viaenvs.STORAGE_REDIS_PASSWORD, which already falls back toREDIS_PASSWORD(aibrix/envs.py).create_storage(StorageType.REDIS)then resolves it instorage/factory.py. When either variable is unset no entry is injected, so the Deployment path and no-auth dev setups are unchanged.Two renderer tests cover the injection and the unset path; the injection test asserts
REDIS_PASSWORDcarries no literalvalue, only asecretKeyRef:The full file passes with no regressions (
37 passed).Related Issues
Resolves: #2262
Important: Before submitting, please complete the description above and review the checklist below.
Contribution Guidelines (Expand for Details)
We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:
Pull Request Title Format
Your PR title should start with one of these prefixes to indicate the nature of the change:
[Bug]: Corrections to existing functionality[CI]: Changes to build process or CI pipeline[Docs]: Updates or additions to documentation[API]: Modifications to aibrix's API or interface[CLI]: Changes or additions to the Command Line Interface[Misc]: For changes not covered above (use sparingly)Note: For changes spanning multiple categories, use multiple prefixes in order of importance.
Submission Checklist
By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.