-
Notifications
You must be signed in to change notification settings - Fork 485
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
Add PreStop configuration option #3170
base: master
Are you sure you want to change the base?
Conversation
@@ -1095,6 +1098,9 @@ func (r *RayClusterReconciler) buildHeadPod(ctx context.Context, instance rayv1. | |||
if len(r.headSidecarContainers) > 0 { | |||
podConf.Spec.Containers = append(podConf.Spec.Containers, r.headSidecarContainers...) | |||
} | |||
if r.PreStopCommand != "" { | |||
podConf.Spec.Containers[utils.RayContainerIndex].Lifecycle = createPreStopLifecycle(r.PreStopCommand) |
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.
Do I have to check if there's already a lifecycle assigned here, or if there's some prestop / poststart commands already assigned that I have to add to? Or is it ok to assume there will no be lifecycle for this container at this point?
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.
yes I think we should check and only set it if not set by the user
I will wait for @andrewsykim to review this PR since he is a user of this API. I will perform a final review later. |
@dayshah would you mind fixing the CI errors https://github.com/ray-project/kuberay/blob/master/ray-operator/DEVELOPMENT.md? |
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
Why are these changes needed?
Gives users an option to add a prestop hook which will drain the ray node when it's triggered.
Related issue number
#3185
Checks