KubeRay CRD API reference#
This page is the generated field reference for the ray.io/v1 custom resource definitions. It covers RayCluster, RayCronJob, RayJob, and RayService, along with the supporting types their fields refer to.
The fields are those of KubeRay v1.6.2. Fields added to KubeRay after that release don’t appear here.
Resource Types#
AuthMode#
Underlying type: string
AuthMode describes the authentication mode for the Ray cluster.
Appears in:
Field |
Description |
|---|---|
|
AuthModeDisabled disables authentication. |
|
AuthModeToken enables token-based authentication. |
AuthOptions#
AuthOptions defines the authentication options for a RayCluster.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
EnableK8sTokenAuth enables Kubernetes-delegated token authentication. |
||
|
SecretName is the name of the Secret that contains the authentication token. |
||
|
Mode specifies the authentication mode. |
Enum: [disabled token] |
AutoscalerOptions#
AutoscalerOptions specifies optional configuration for the Ray autoscaler.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Resources specifies optional resource request and limit overrides for the autoscaler container. |
||
|
Image optionally overrides the autoscaler’s container image. This override is provided for autoscaler testing and development. |
||
|
ImagePullPolicy optionally overrides the autoscaler container’s image pull policy. This override is provided for autoscaler testing and development. |
||
|
SecurityContext defines the security options the container should be run with. |
||
|
IdleTimeoutSeconds is the number of seconds to wait before scaling down a worker pod which is not using Ray resources. |
||
|
UpscalingMode is “Conservative”, “Default”, or “Aggressive.” |
Enum: [Default Aggressive Conservative] |
|
|
Version is the version of the Ray autoscaler. |
Enum: [v1 v2] |
|
|
Optional list of environment variables to set in the autoscaler container. |
||
|
Optional list of sources to populate environment variables in the autoscaler container. |
||
|
Optional list of volumeMounts. This is needed for enabling TLS for the autoscaler container. |
AutoscalerVersion#
Underlying type: string
Validation:
Enum: [v1 v2]
Appears in:
Field |
Description |
|---|---|
|
|
|
ClusterUpgradeOptions#
These options are currently only supported for the IncrementalUpgrade type.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
The capacity of serve requests the upgraded cluster should scale to handle each interval. |
100 |
|
|
The percentage of traffic to switch to the upgraded RayCluster at a set interval after scaling by MaxSurgePercent. |
||
|
The interval in seconds between transferring StepSize traffic from the old to new RayCluster. |
||
|
The name of the Gateway Class installed by the Kubernetes Cluster admin. |
DeletionCondition#
DeletionCondition specifies the trigger conditions for a deletion action. Exactly one of JobStatus or JobDeploymentStatus must be specified:
JobStatus (application-level): Match the Ray job execution status.
JobDeploymentStatus (infrastructure-level): Match the RayJob deployment lifecycle status. This is particularly useful for cleaning up resources when Ray jobs fail to be submitted.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
TTLSeconds is the time in seconds from when the JobStatus or JobDeploymentStatus |
0 |
Minimum: 0 |
DeletionPolicy#
DeletionPolicy is the legacy single-stage deletion policy. Deprecated: This struct is part of the legacy API. Use DeletionRule for new configurations.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Policy is the action to take when the condition is met. |
Enum: [DeleteCluster DeleteWorkers DeleteSelf DeleteNone] |
DeletionPolicyType#
Underlying type: string
Appears in:
Field |
Description |
|---|---|
|
|
|
|
|
|
|
DeletionRule#
DeletionRule defines a single deletion action and its trigger condition. This is the new, recommended way to define deletion behavior.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Policy is the action to take when the condition is met. This field is required. |
Enum: [DeleteCluster DeleteWorkers DeleteSelf DeleteNone] |
|
|
The condition under which this deletion rule is triggered. This field is required. |
DeletionStrategy#
DeletionStrategy configures automated cleanup after the RayJob reaches a terminal state. Two mutually exclusive styles are supported:
Legacy: provide both onSuccess and onFailure (deprecated; removal planned for 1.6.0). May be combined with shutdownAfterJobFinishes and (optionally) global TTLSecondsAfterFinished.
Rules: provide deletionRules (non-empty list). Rules mode is incompatible with shutdownAfterJobFinishes, legacy fields, and the global TTLSecondsAfterFinished (use per-rule condition.ttlSeconds instead).
Semantics:
A non-empty deletionRules selects rules mode; empty lists are treated as unset.
Legacy requires both onSuccess and onFailure; specifying only one is invalid.
Global TTLSecondsAfterFinished > 0 requires shutdownAfterJobFinishes=true; therefore it cannot be used with rules mode or with legacy alone (no shutdown).
Feature gate RayJobDeletionPolicy must be enabled when this block is present.
Validation:
CRD XValidations prevent mixing legacy fields with deletionRules and enforce legacy completeness.
Controller logic enforces rules vs shutdown exclusivity and TTL constraints.
onSuccess/onFailure are deprecated; migration to deletionRules is encouraged.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
OnSuccess is the deletion policy for a successful RayJob. |
||
|
OnFailure is the deletion policy for a failed RayJob. |
||
|
DeletionRules is a list of deletion rules, processed based on their trigger conditions. |
MinItems: 1 |
GcsFaultToleranceOptions#
GcsFaultToleranceOptions contains configs for GCS FT
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
|||
|
|||
|
|||
|
HeadGroupSpec#
HeadGroupSpec are the spec for the head pod
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Template is the exact pod template used in K8s deployments, statefulsets, etc. |
||
|
HeadService is the Kubernetes service of the head pod. |
||
|
EnableIngress indicates whether operator should create ingress object for head service or not. |
||
|
Resources specifies the resource quantities for the head group. |
||
|
Labels specifies the Ray node labels for the head group. |
||
|
RayStartParams are the params of the start command: node-manager-port, object-store-memory, … |
||
|
ServiceType is Kubernetes service type of the head service. it will be used by the workers to connect to the head pod |
JobSubmissionMode#
Underlying type: string
Appears in:
Field |
Description |
|---|---|
|
|
|
|
|
|
|
RayCluster#
RayCluster is the Schema for the RayClusters API
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
|
||
|
|
||
|
Refer to Kubernetes API documentation for fields of |
||
|
Specification of the desired behavior of the RayCluster. |
RayClusterSpec#
RayClusterSpec defines the desired state of RayCluster
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
UpgradeStrategy defines the scaling policy used when upgrading the RayCluster |
||
|
AuthOptions specifies the authentication options for the RayCluster. |
||
|
Suspend indicates whether a RayCluster should be suspended. |
||
|
ManagedBy is an optional configuration for the controller or entity that manages a RayCluster. |
||
|
AutoscalerOptions specifies optional configuration for the Ray autoscaler. |
||
|
|||
|
EnableInTreeAutoscaling indicates whether operator should create in tree autoscaling configs |
||
|
GcsFaultToleranceOptions for enabling GCS FT |
||
|
HeadGroupSpec is the spec for the head pod |
||
|
RayVersion is used to determine the command for the Kubernetes Job managed by RayJob |
||
|
WorkerGroupSpecs are the specs for the worker pods |
RayClusterUpgradeStrategy#
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
Type represents the strategy used when upgrading the RayCluster Pods. Currently supports |
Enum: [Recreate None] |
RayClusterUpgradeType#
Underlying type: string
Validation:
Enum: [Recreate None]
Appears in:
Field |
Description |
|---|---|
|
During upgrade, Recreate strategy will delete all existing pods before creating new ones |
|
No new pod will be created while the strategy is set to None |
RayCronJob#
RayCronJob is the Schema for the raycronjobs API
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
|
||
|
|
||
|
Refer to Kubernetes API documentation for fields of |
||
|
RayCronJobSpec#
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
JobTemplate defines the job spec that will be created by cron scheduling |
||
|
Schedule is the cron schedule string |
||
|
Suspend tells the controller to suspend the scheduling, it does not apply to |
RayJob#
RayJob is the Schema for the rayjobs API
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
|
||
|
|
||
|
Refer to Kubernetes API documentation for fields of |
||
|
RayJobSpec#
RayJobSpec defines the desired state of RayJob
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
ActiveDeadlineSeconds is the duration in seconds that the RayJob may be active before |
||
|
Specifies the number of retries before marking this job failed. |
0 |
|
|
RayClusterSpec is the cluster template to run the job |
||
|
SubmitterPodTemplate is the template for the pod that will run |
||
|
Refer to Kubernetes API documentation for fields of |
||
|
clusterSelector is used to select running rayclusters by labels |
||
|
Configurations of submitter k8s job. |
||
|
ManagedBy is an optional configuration for the controller or entity that manages a RayJob. |
||
|
DeletionStrategy automates post-completion cleanup. |
||
|
Entrypoint represents the command to start execution. |
||
|
RuntimeEnvYAML represents the runtime environment configuration |
||
|
If jobId is not set, a new jobId will be auto-generated. |
||
|
SubmissionMode specifies how RayJob submits the Ray job to the RayCluster. |
K8sJobMode |
|
|
EntrypointResources specifies the custom resources and quantities to reserve for the |
||
|
EntrypointNumCpus specifies the number of cpus to reserve for the entrypoint command. |
||
|
EntrypointNumGpus specifies the number of gpus to reserve for the entrypoint command. |
||
|
TTLSecondsAfterFinished is the TTL to clean up RayCluster. |
0 |
|
|
PreRunningDeadlineSeconds is the deadline in seconds for a RayJob to reach the Running state |
Minimum: 1 |
|
|
ShutdownAfterJobFinishes will determine whether to delete the ray cluster once rayJob succeed or failed. |
||
|
suspend specifies whether the RayJob controller should create a RayCluster instance |
RayService#
RayService is the Schema for the rayservices API
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
|
||
|
|
||
|
Refer to Kubernetes API documentation for fields of |
||
|
RayServiceSpec#
RayServiceSpec defines the desired state of RayService
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
RayClusterDeletionDelaySeconds specifies the delay, in seconds, before deleting old RayClusters. |
Minimum: 0 |
|
|
Deprecated: This field is not used anymore. ref: https://github.com/ray-project/kuberay/issues/1685 |
||
|
Deprecated: This field is not used anymore. ref: https://github.com/ray-project/kuberay/issues/1685 |
||
|
ServeService is the Kubernetes service for head node and worker nodes who have healthy http proxy to serve traffics. |
||
|
UpgradeStrategy defines the scaling policy used when upgrading the RayService. |
||
|
ManagedBy is an optional configuration for the controller or entity that manages a RayService. |
||
|
Important: Run “make” to regenerate code after modifying this file |
||
|
|||
|
If the field is set to true, the value of the label |
RayServiceUpgradeStrategy#
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
Type represents the strategy used when upgrading the RayService. Currently supports |
|||
|
ClusterUpgradeOptions defines the behavior of a NewClusterWithIncrementalUpgrade type. |
RayServiceUpgradeType#
Underlying type: string
Appears in:
Field |
Description |
|---|---|
|
During upgrade, NewClusterWithIncrementalUpgrade strategy will create an upgraded cluster to gradually scale |
|
During upgrade, NewCluster strategy will create new upgraded cluster and switch to it when it becomes ready |
|
No new cluster will be created while the strategy is set to None |
RedisCredential#
RedisCredential is the redis username/password or a reference to the source containing the username/password
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
|||
|
ScaleStrategy#
ScaleStrategy to remove workers
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
WorkersToDelete workers to be deleted |
SubmitterConfig#
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
BackoffLimit of the submitter k8s job. |
UpscalingMode#
Underlying type: string
Validation:
Enum: [Default Aggressive Conservative]
Appears in:
WorkerGroupSpec#
WorkerGroupSpec are the specs for the worker pods
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Suspend indicates whether a worker group should be suspended. |
||
|
we can have multiple worker groups, we distinguish them by name |
||
|
Replicas is the number of desired Pods for this worker group. See https://github.com/ray-project/kuberay/pull/1443 for more details about the reason for making this field optional. |
0 |
|
|
MinReplicas denotes the minimum number of desired Pods for this worker group. |
0 |
|
|
MaxReplicas denotes the maximum number of desired Pods for this worker group, and the default value is maxInt32. |
2147483647 |
|
|
IdleTimeoutSeconds denotes the number of seconds to wait before the v2 autoscaler terminates an idle worker pod of this type. |
||
|
Resources specifies the resource quantities for this worker group. |
||
|
Labels specifies the Ray node labels for this worker group. |
||
|
RayStartParams are the params of the start command: address, object-store-memory, … |
||
|
Template is a pod template for the worker |
||
|
ScaleStrategy defines which pods to remove |
||
|
NumOfHosts denotes the number of hosts to create per replica. The default value is 1. |
1 |