Skip to content

[Bug] Propagate Redis password to KubernetesJob batch worker - #2366

Merged
varungup90 merged 2 commits into
vllm-project:mainfrom
V-3604:varshith/bug_fix_worker_redis_password_secret
Jun 23, 2026
Merged

varungup90 merged 2 commits into
vllm-project:mainfrom
V-3604:varshith/bug_fix_worker_redis_password_secret

Conversation

@V-3604

@V-3604 V-3604 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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 from build_metastore_env() in aibrix/batch/manifest/storage_env.py. _redis_env() emitted REDIS_HOST, REDIS_PORT, and REDIS_DB only, omitting the password. On a Redis that requires authentication the worker connected unauthenticated and metastore I/O failed, so the batch produced no results. The Kubernetes (Deployment) path is unaffected, since it does its I/O in the metadata process.

_redis_env() now appends a REDIS_PASSWORD env sourced from valueFrom.secretKeyRef when both WORKER_REDIS_PASSWORD_SECRET_NAME and WORKER_REDIS_PASSWORD_SECRET_KEY are set, mirroring the existing WORKER_REDIS_HOST override. The password is delivered through a Secret, never a literal pod-spec value. The worker reads it via envs.STORAGE_REDIS_PASSWORD, which already falls back to REDIS_PASSWORD (aibrix/envs.py). create_storage(StorageType.REDIS) then resolves it in storage/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_PASSWORD carries no literal value, only a secretKeyRef:

pytest tests/batch/test_manifest_renderer.py -k redis_password -v
tests/batch/test_manifest_renderer.py::TestMetastoreEnv::test_worker_redis_password_injected_as_secret_ref PASSED
tests/batch/test_manifest_renderer.py::TestMetastoreEnv::test_redis_password_secret_ref_omitted_when_unset PASSED
2 passed, 35 deselected

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

  • PR title includes appropriate prefix(es)
  • Changes are clearly explained in the PR description
  • New and existing tests pass successfully
  • Code adheres to project style and best practices
  • Documentation updated to reflect changes (if applicable)
  • Thorough testing completed, no regressions introduced

By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@varungup90
varungup90 requested review from DwyaneShi and zhangjyr June 22, 2026 23:33
@varungup90
varungup90 merged commit b43f1bf into vllm-project:main Jun 23, 2026
12 checks passed
@V-3604
V-3604 deleted the varshith/bug_fix_worker_redis_password_secret branch June 23, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KubernetesJob batch worker does not receive Redis password → fails on an authenticated metastore

2 participants