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.7.0. 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. |
||
|
Optional list overwrite the default command of the autoscaler container. |
||
|
Optional to overwrite the default args of 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. |
CollectorOptions#
CollectorOptions defines settings for the history server collector sidecar.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Image is the collector container image to be used (e.g. quay.io/kuberay/collector:latest). |
||
|
ImagePullPolicy is the pull policy for the collector image. |
||
|
Resources specifies computing resource requirements. |
||
|
Env allows injecting custom environment variables into the collector container. |
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 |
GCSStorageDeletionPolicy#
Underlying type: string
GCSStorageDeletionPolicy specifies what happens to the operator-managed GCS storage PVC when the owning RayCluster is deleted.
Validation:
Enum: [DeleteWithCluster Retain]
Appears in:
Field |
Description |
|---|---|
|
DeleteWithClusterGCSStorageDeletionPolicy (the default) makes the |
|
RetainGCSStorageDeletionPolicy keeps the operator-managed PVC (and its data) |
GcsEmbeddedStorage#
GcsEmbeddedStorage configures the PVC backing the embedded RocksDB store.
RocksDB tolerates only a single writer at a time. The operator mounts the volume on the head Pod but does not itself enforce mutual exclusion, so when a volume can be attached to more than one Pod concurrently (see AccessModes) the caller is responsible for ensuring only one Ray head writes to it at a time.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
ClaimName is the name of an existing, user-provided PersistentVolumeClaim to |
||
|
Size of the operator-managed PVC (e.g. “1Gi”). Ignored when ClaimName is set. |
||
|
StorageClassName for the operator-managed PVC. Uses the cluster default |
||
|
AccessModes for the operator-managed PVC. Defaults to [ReadWriteOnce]. |
||
|
SubPath mounts a subdirectory of the volume instead of its root. |
||
|
DeletionPolicy controls the lifecycle of the operator-managed PVC relative to |
Enum: [DeleteWithCluster Retain] |
GcsFaultToleranceBackend#
Underlying type: string
GcsFaultToleranceBackend selects the GCS fault tolerance persistence backend.
Validation:
Enum: [redis rocksdb]
Appears in:
Field |
Description |
|---|---|
|
GcsFTBackendRedis persists GCS metadata in an external Redis service. |
|
GcsFTBackendRocksDB persists GCS metadata in an embedded RocksDB store on a |
GcsFaultToleranceOptions#
GcsFaultToleranceOptions contains configs for GCS FT
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Backend selects the GCS FT persistence backend. Defaults to “redis” for |
Enum: [redis rocksdb] |
|
|
|||
|
|||
|
|||
|
RedisAddress is the address of the external Redis service used when Backend |
||
|
Storage configures the persistent volume backing the embedded RocksDB |
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. |
||
|
IngressOptions specifies optional ingress configuration for the head service. |
||
|
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 |
HistoryServerOptions#
HistoryServerOptions used for history server related configuration
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
CollectorOptions used for collector sidecar configuration |
IngressOptions#
IngressOptions defines the host, path, and TLS configuration for the ingress generated for the head group.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Host is the fully-qualified domain name used to route external traffic to the |
||
|
Path is the HTTP path that routes to the Ray head dashboard. |
||
|
PathType is the path matching mode applied to Path. |
Enum: [Exact Prefix ImplementationSpecific] |
|
|
TLS configures TLS termination for the generated ingress. |
IngressPathType#
Underlying type: string
Validation:
Enum: [Exact Prefix ImplementationSpecific]
Appears in:
Field |
Description |
|---|---|
|
|
|
|
|
JobSubmissionMode#
Underlying type: string
Appears in:
Field |
Description |
|---|---|
|
|
|
|
|
|
|
NetworkPolicyConfig#
NetworkPolicyConfig defines network isolation settings for Ray cluster. All modes permit intra-cluster pod-to-pod traffic. DNS egress is not included automatically; see NetworkPolicyRules.EgressRules for why it must be added under DenyAll/DenyAllEgress.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Mode controls the security level. All modes permit intra-cluster pod-to-pod |
DenyAll |
Enum: [DenyAll DenyAllIngress DenyAllEgress] |
|
Head specifies custom NetworkPolicy rules applied only to the head pod’s policy. |
||
|
Worker specifies custom NetworkPolicy rules applied only to worker pods’ policy. |
||
|
WorkerGroups specifies per-worker-group NetworkPolicy rules, keyed by group name. |
NetworkPolicyMode#
Underlying type: string
NetworkPolicyMode is the type for network isolation mode constants.
Validation:
Enum: [DenyAll DenyAllIngress DenyAllEgress]
Appears in:
Field |
Description |
|---|---|
|
NetworkPolicyDenyAll denies all ingress and egress traffic. |
|
NetworkPolicyDenyAllIngress denies all ingress traffic. |
|
NetworkPolicyDenyAllEgress denies all egress traffic. |
NetworkPolicyRules#
NetworkPolicyRules defines custom ingress and egress rules for a NetworkPolicy.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
IngressRules specifies custom ingress rules appended to the base policy. |
||
|
EgressRules specifies custom egress rules appended to the base policy. |
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 |
||
|
HistoryServerOptions used for history server related configuration |
||
|
NetworkPolicy specifies optional configuration for network isolation. |
||
|
TLSOptions specifies optional TLS encryption settings for the RayCluster. |
||
|
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 |
||
|
TimeZone is the time zone name for the given schedule. If not specified, default to the local time zone of the |
MinLength: 1 |
|
|
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 |
||
|
Suspend indicates whether the RayService should suspend its execution. When set to true, |
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. In K8sJobMode, this is the K8s Job backoffLimit. |
TLSOptions#
TLSOptions configures TLS encryption for the RayCluster. When TLSOptions is nil or Enabled is nil/false, TLS is disabled. When Enabled is true, the operator uses cert-manager to automatically provision a full PKI (self-signed CA, head and worker leaf certificates) and keeps certificates up to date as pod IPs change during autoscaling.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
Enabled controls whether mTLS is active for this RayCluster. |
UpscalingMode#
Underlying type: string
Validation:
Enum: [Default Aggressive Conservative]
Appears in:
WorkerGroupNetworkPolicyRules#
WorkerGroupNetworkPolicyRules is NetworkPolicyRules bound to one worker group.
Appears in:
Field |
Description |
Default |
Validation |
|---|---|---|---|
|
GroupName matches WorkerGroupSpec.GroupName. |
Required: {} |
|
|
IngressRules specifies custom ingress rules appended to the base policy. |
||
|
EgressRules specifies custom egress rules appended to the base policy. |
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. |
||
|
Priority influences which worker group the autoscaler prefers when multiple |
0 |
|
|
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 |