Skip to content

[Doc] KubeRay SidecarSubmitterRestart User Guide - #64303

Merged
andrewsykim merged 9 commits into
ray-project:masterfrom
justinyeh1995:doc/ray-on-k8s-sidecar-submitter-restart
Aug 10, 2026
Merged

andrewsykim merged 9 commits into
ray-project:masterfrom
justinyeh1995:doc/ray-on-k8s-sidecar-submitter-restart

Conversation

@justinyeh1995

@justinyeh1995 justinyeh1995 commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR documents the usage and limitation of the feature gate SidecarSubmitterRestart.

Related issues

KubeRay #4285

Additional information

Preview links can be reviewed at RayJob Quick Start Submission configuration & A more detailed user guide

Signed-off-by: justinyeh1995 <[email protected]>
@justinyeh1995
justinyeh1995 requested review from a team and andrewsykim as code owners June 24, 2026 07:47

@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 updates the rayjob-quick-start.md documentation to detail the new SidecarSubmitterRestart feature gate, which allows the submitter container to restart on transient failures. The review feedback highlights two critical inaccuracies in the added documentation: first, Kubernetes native sidecar containers only support Always as a container-level restartPolicy rather than OnFailure; second, the specified version requirements (Kubernetes v1.35+ and Ray v2.54.0+) are incorrect and appear to be typos.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

* `submitterConfig` (Optional): Additional configurations for the submitter. Used in `K8sJobMode` and `SidecarMode` when `SidecarSubmitterRestart` is enabled.
* `backoffLimit` (Optional, added in version 1.2.0): The number of retries before marking the submitter as failed. The default value is 2.
* `SidecarSubmitterRestart` (alpha in v1.7): This feature gate (disabled by default), when set, allows the submitter container to restart on transient submitter failures.
* The submitter container's `restartPolicy` is set to `OnFailure` at the container level. It is independent of the head Pod's pod-level `RestartPolicy: Never`, so a non-zero exit restarts only the submitter container in place without touching the `ray-head` container. Note that a failure of the Ray job's own code does not make the submitter exit non-zero, so it won't trigger a restart by itself.

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.

medium

In Kubernetes, native sidecar containers (configured as initContainers with a container-level restartPolicy under the ContainerRestartRules feature) only support Always as the valid value for restartPolicy. There is no native OnFailure container-level restart policy in the Kubernetes Pod specification.

Could you clarify if KubeRay is setting Always under the hood and managing the exit behavior, or if there is a custom controller mechanism? If it actually uses Always, the documentation should be updated to reflect that, as setting OnFailure at the container level is not supported by the Kubernetes API.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ContainerRestartRules is a stable feature for configuring restart policy for containers in K8s v1.35+, and OnFailure is a valid value there.

Comment on lines +68 to +69
* Requires Kubernetes v1.35+ (`ContainerRestartRules` supported by default) and Ray v2.54.0+.
* The KubeRay operator only validates the API server version. Per the Kubernetes version skew policy, worker node kubelets can be up to 3 minor versions older, so make sure the node running the Ray head Pod is also on v1.35+. If that kubelet doesn't support `ContainerRestartRules`, the per-container restart policy is silently ignored, and the operator's default 30-second submitter-finished timeout can mark the RayJob `Failed` even though the Ray job is still running.

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.

medium

The version requirements mentioned here seem to contain typos:

  1. Kubernetes v1.35+: Kubernetes v1.35 does not exist yet (v1.32 is the latest release as of late 2024/early 2025). The ContainerRestartRules feature (sidecar containers) was introduced in v1.28 and enabled by default in v1.29. This should likely be corrected to v1.29+ (or v1.28+).
  2. Ray v2.54.0+: Ray v2.54.0 does not exist yet (current versions are in the v2.30s/v2.40s). Please verify and correct this to the actual Ray version that introduced or supports this feature (e.g., v2.35.0+ or similar).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

K8s version is already v1.36. Ray is also v2.55

@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Jun 24, 2026
* `HTTPMode`: The KubeRay operator sends a request to the RayCluster to create a Ray job.
* `InteractiveMode`: The KubeRay operator waits for the user to submit a job to the RayCluster. This mode is currently in alpha and the [KubeRay kubectl plugin](kubectl-plugin) relies on it.
* `SidecarMode`: The KubeRay operator injects a container into the Ray head Pod to submit the Ray job. This mode does not support `clusterSelector`, `submitterPodTemplate`, and `submitterConfig`, and requires the head Pod's restart policy to be `Never`.
* `SidecarMode`: The KubeRay operator injects a container into the Ray head Pod to submit the Ray job. This mode does not support `clusterSelector`, `submitterPodTemplate`, and requires the head Pod's restart policy to be `Never`. When the `SidecarSubmitterRestart` feature gate is enabled, `submitterConfig.backoffLimit` is used to cap the submitter sidecar's restart count.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you also mention the required

  1. kubernetes version
  2. kuberay version

@Future-Outlier Future-Outlier added the go add ONLY when ready to merge, run all tests label Jun 29, 2026
@Future-Outlier Future-Outlier self-assigned this Jun 29, 2026
Signed-off-by: justinyeh1995 <[email protected]>
@justinyeh1995

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 updates the rayjob-quick-start.md documentation to introduce the new SidecarSubmitterRestart feature gate, which allows the submitter container to restart on transient failures in SidecarMode. The review feedback focuses on improving the clarity, grammatical correctness, and professionalism of the documentation. Key suggestions include correcting list structures, clarifying configuration usage, using consistent casing for Kubernetes API fields, and refining the phrasing for better technical accuracy.

@justinyeh1995
justinyeh1995 marked this pull request as draft July 1, 2026 11:02
Signed-off-by: justinyeh1995 <[email protected]>
@justinyeh1995
justinyeh1995 marked this pull request as ready for review July 3, 2026 14:21
@justinyeh1995
justinyeh1995 requested a review from a team as a code owner July 3, 2026 14:21
@justinyeh1995

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 adds documentation for the new SidecarSubmitterRestart feature gate in RayJob, including a detailed user guide with step-by-step verification instructions. The review feedback suggests improving the prerequisites list formatting for clarity and correcting the Helm chart version parameter in the installation command to avoid errors.

Comment on lines +8 to +9
* This feature requires Kubernetes v1.35+.
* KubeRay v1.7.0 or higher: Ray v2.54.0 or higher.

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.

medium

The current nesting makes KubeRay and Ray appear as sub-requirements of Kubernetes v1.35+, which is semantically incorrect as they are independent prerequisites. Additionally, using a colon : between KubeRay and Ray is a bit unclear. It would be cleaner and more accurate to list them as separate, flat bullet points.

Suggested change
* This feature requires Kubernetes v1.35+.
* KubeRay v1.7.0 or higher: Ray v2.54.0 or higher.
* This feature requires Kubernetes v1.35+.
* KubeRay v1.7.0 or higher.
* Ray v2.54.0 or higher.

### Step 2: Install the KubeRay operator with `SidecarSubmitterRestart` enabled

```sh
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version v1.7.0 \

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.

medium

The Helm chart version for KubeRay does not use the v prefix (e.g., it is 1.7.0 instead of v1.7.0). Specifying --version v1.7.0 will cause the helm upgrade command to fail with a "chart not found" error.

Suggested change
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version v1.7.0 \
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \

Signed-off-by: justinyeh1995 <[email protected]>
@justinyeh1995

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 documentation and a new user guide for the SidecarSubmitterRestart feature gate in KubeRay, which enables the submitter container to restart on transient failures without failing the RayJob. The review feedback suggests two improvements to the new user guide: using a higher index when setting the feature gate via Helm to prevent overwriting default feature gates, and utilizing a more targeted JSONPath expression to query the restart count of the submitter container.

Comment on lines +23 to +25
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \
--set "featureGates[0].name=SidecarSubmitterRestart" \
--set "featureGates[0].enabled=true"

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.

medium

Using index 0 for featureGates will overwrite the default feature gate at index 0 (which is RayClusterStatusConditions, enabled by default). To avoid disabling default feature gates, it is safer to append the new feature gate at the next available index (index 5 in KubeRay v1.7.0).

Suggested change
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \
--set "featureGates[0].name=SidecarSubmitterRestart" \
--set "featureGates[0].enabled=true"
helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \
--set "featureGates[5].name=SidecarSubmitterRestart" \
--set "featureGates[5].enabled=true"

@justinyeh1995 justinyeh1995 Jul 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think setting it to 0 is correct.

the values.yaml in helm repo defines 5 feature gates and 3 of them are turned on by default.

helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \
  --set "featureGates[0].name=SidecarSubmitterRestart" \
  --set "featureGates[0].enabled=true"

replace it with only SidecarSubmitterRestart set to true. This is fine because in features.go. The three of the turned on feature gates are mark as on here as well, so the operator will fall back to use it.

On the other hand, the suggestion of using

helm upgrade --install kuberay-operator kuberay/kuberay-operator --version 1.7.0 \
  --set "featureGates[5].name=SidecarSubmitterRestart" \
  --set "featureGates[5].enabled=true"

will break the installation.

Comment on lines +131 to +132
kubectl get pod $HEAD_POD \
-o jsonpath='{range .status.containerStatuses[*]}{.name}{" restartCount="}{.restartCount}{"\n"}{end}'

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.

medium

Instead of printing the restart counts of all containers in the pod, you can target the ray-job-submitter container directly using a filtered JSONPath expression. This makes the output cleaner and easier to verify.

Suggested change
kubectl get pod $HEAD_POD \
-o jsonpath='{range .status.containerStatuses[*]}{.name}{" restartCount="}{.restartCount}{"\n"}{end}'
kubectl get pod $HEAD_POD \
-o jsonpath='{.status.containerStatuses[?(@.name=="ray-job-submitter")].restartCount}{"\n"}'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

kubectl get pod $HEAD_POD \
  -o jsonpath='{range .status.containerStatuses[*]}{.name}{" restartCount="}{.restartCount}{"\n"}{end}'

# ray-head restartCount=0
# ray-job-submitter restartCount=1

I would like the user to see ray-head is not restarted as well.

@justinyeh1995

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 updates the documentation to introduce and explain the new SidecarSubmitterRestart feature gate (alpha in KubeRay v1.7). It updates the RayJob quickstart guide to detail how this feature allows the submitter container to restart on transient failures without restarting the head container. Additionally, it adds a new user guide with step-by-step instructions to enable and verify this feature on a local Kubernetes cluster using kind. There are no review comments, so no feedback is provided.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jul 22, 2026
@justinyeh1995

Copy link
Copy Markdown
Contributor Author

comment to unstale it

@dstrodtman dstrodtman 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.

I'm unfamiliar with this tech; we'll need review and approval from a technical SME before I do a docs edit pass. Please ping me once you get that.

@justinyeh1995

Copy link
Copy Markdown
Contributor Author

I'm unfamiliar with this tech; we'll need review and approval from a technical SME before I do a docs edit pass. Please ping me once you get that.

Will do just that! Hi @Future-Outlier, would love to get another round of review when you have the time. Thanks.

@github-actions github-actions Bot added unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it. and removed stale The issue is stale. It will be closed within 7 days unless there are further conversation labels Jul 23, 2026
@edoakes edoakes assigned rueian and andrewsykim and unassigned Future-Outlier and rueian Jul 23, 2026

@andrewsykim andrewsykim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just some nits

* KubeRay v1.7.0 or higher.
* Ray v2.54.0 or higher.

## Behavior and caveats

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm sure this was mentioned in the original user guide for sidecar mode, but we should also highlight the benefits and reasons to use sidecar mode here as well

@justinyeh1995 justinyeh1995 Jul 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in fbcb0d5. I added it in the intro section as I think it fits more naturally. The content is mostly referenced from the original issue #3928 & pr #3971, which mentions avoiding inter-pod communication, image reuse, and easier scheduling.

The submitter container should restart and reattach to the log stream. The RayJob should remain `Running`:

```sh
# restartCount for ray-job-submitter should increment to 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should also mention ray-head container should remain at 0

@justinyeh1995 justinyeh1995 Jul 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in fbcb0d5. Thank you for the review!

@justinyeh1995

Copy link
Copy Markdown
Contributor Author

Also, I modified the heredoc in Step 3 and clarified how submitterConfig behaves in SidecarMode. The memory limit for ray-head changed to 5Gi as 2Gi OOMed when I ran it.

@justinyeh1995

Copy link
Copy Markdown
Contributor Author

Hi @dstrodtman, the changes had been reviewed by Andrew. Would love to get your review once you get the time. Thank you.

@dstrodtman dstrodtman 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.

stamping to unblock

@andrewsykim
andrewsykim merged commit 28fb2d4 into ray-project:master Aug 10, 2026
6 checks passed
Artimislyy pushed a commit to Artimislyy/ray that referenced this pull request Aug 11, 2026
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
dstrodtman added a commit that referenced this pull request Aug 28, 2026
## Why

The [KubeRay v1.7 blog](https://www.anyscale.com/blog/kuberay-v1-7)
highlights several features whose docs currently live only on `master`.
The corresponding pages are missing (404) or incomplete on the `latest`
(2.58.0) docs build, and several blog links point at `/master` as a
result. This backports the doc pages so the 2.58.0 `latest` docs cover
the released KubeRay v1.7 surface.

## What (cherry-picks onto `releases/2.58.0`)

| Commit | Blog feature | Gap on `latest` |
|---|---|---|
| #64303 | RayJob `SidecarMode` retry | new page was missing |
| #65249 | RayService incremental upgrade rollback (beta) | `#rollback`
section missing |
| #65074 | NetworkPolicy support (alpha) | new page was missing |
| #65429 | Embedded RocksDB GCS backend | example version pin missing |
| #65513 | Fix docs for KubeRay v1.7 | wrong NetworkPolicy field names +
incorrect `kubernetes` pip guidance |
| #65483 | Customizable Ingress options | `ingressOptions` undocumented
|

Each commit is applied with `cherry-pick -x` (provenance preserved) and
DCO sign-off.

## Not duplicating

- No open PR cherry-picks these into `releases/2.58.0` (checked by PR
number and by `--base releases/2.58.0`).
- The two History Server refinements (#65441, #65505) are intentionally
**excluded** — they already landed on `releases/2.58.0` (`c6061c10b97`,
`d8277b53b0d`) and that page is already identical to `master`.
- Broad, non-feature changes touching these files on `master` (llms.txt
page descriptions #65115, the "Ray Pod" terminology rename #65423, the
vendored CRD API reference #65428) are deliberately left out to keep
this a tight, low-risk release-branch backport.

## Testing

- Verified every new/changed page's `{ref}`/`{doc}` cross-reference
target resolves on this branch (`fail_on_warning: true` build safety).
- Verified both new toctree entries (`network-policy`,
`rayjob-sidecar-submitter-restart`) point at files that exist on the
branch.
- Confirmed each touched file matches `master` except for the
intentionally-excluded frontmatter/rename hunks above.
- A full local Sphinx docs build is recommended before marking ready for
review.

AI assistance (Claude Code) was used to prepare this backport.

---------

Signed-off-by: justinyeh1995 <[email protected]>
Signed-off-by: Justin Yeh <[email protected]>
Signed-off-by: JustinYeh <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Signed-off-by: win5923 <[email protected]>
Signed-off-by: Paul Nolan <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: wuallen57730 <[email protected]>
Co-authored-by: JustinYeh <[email protected]>
Co-authored-by: Jun-Hao Wan <[email protected]>
Co-authored-by: Pat O'Connor <[email protected]>
Co-authored-by: David Adamache <[email protected]>
Co-authored-by: Paul Nolan <[email protected]>
Co-authored-by: Nary Yeh <[email protected]>
Co-authored-by: Lima <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants