Skip to content
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

[Feature] Read Redis password from Kubernetes Secret #950

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Mar 9, 2023

Why are these changes needed?

#949

Related issue number

Closes #949

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(
# Step 1: Install a KubeRay operator
# Step 2: Create a RayCluster (path: ray-operator/config/samples)
kubectl apply -f ray-cluster.external-redis.yaml

# Step 3: Log in to the head Pod
kubectl exec -it ${HEAD_POD} -- bash
echo $RAY_REDIS_PASSWORD
# 5241590000000000

@kevin85421
Copy link
Member Author

cc @scv119 @JoshKarpel

@JoshKarpel
Copy link
Contributor

Looks good to me!

Just to make sure I understand the pattern - you're passing the string $RAY_REDIS_PASSWORD as a start param, and that gets evaluated at runtime because these values end up going (unescaped) into a sh -c? The actual RAY_REDIS_PASSWORD env var does not get picked up internally by Ray.

If so, this might be a good pattern to capture somewhere in the docs in text (using env vars to pass information via start params). It might also be good to pick up the RAY_REDIS_PASSWORD env var in Ray directly so that you don't need the indirection of the start param (perhaps related to the comment here #949 (comment)).

@kevin85421
Copy link
Member Author

KubeRay operator will create Pod's command and args based on rayStartParams. In addition, Kubernetes also supports to use environment variables in a Pod's configuration elsewhere in the configuration (See here fore more details.).

The following figure is the command and args for the head Pod.
Screen Shot 2023-03-08 at 8 42 43 PM

@JoshKarpel
Copy link
Contributor

Great, thanks!

@kevin85421 kevin85421 merged commit f747a99 into ray-project:master Mar 9, 2023
lowang-bh pushed a commit to lowang-bh/kuberay that referenced this pull request Sep 24, 2023
Read Redis password from Kubernetes Secret
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.

[Feature] Read Redis password from Kubernetes Secret
3 participants