You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/api.md
+60-5Lines changed: 60 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,11 +55,28 @@ _Appears in:_
55
55
56
56
57
57
58
-
#### DeletionPolicy
58
+
#### DeletionCondition
59
+
60
+
61
+
62
+
DeletionCondition specifies the trigger conditions for a deletion action.
63
+
64
+
65
+
66
+
_Appears in:_
67
+
-[DeletionRule](#deletionrule)
59
68
69
+
| Field | Description | Default | Validation |
70
+
| --- | --- | --- | --- |
71
+
|`ttlSeconds`_integer_| TTLSeconds is the time in seconds from when the JobStatus<br />reaches the specified terminal state to when this deletion action should be triggered.<br />The value must be a non-negative integer. | 0 | Minimum: 0 <br /> |
72
+
73
+
74
+
#### DeletionPolicy
60
75
61
76
62
77
78
+
DeletionPolicy is the legacy single-stage deletion policy.
79
+
Deprecated: This struct is part of the legacy API. Use DeletionRule for new configurations.
63
80
64
81
65
82
@@ -68,7 +85,7 @@ _Appears in:_
68
85
69
86
| Field | Description | Default | Validation |
70
87
| --- | --- | --- | --- |
71
-
|`policy`_[DeletionPolicyType](#deletionpolicytype)_|Valid values are 'DeleteCluster', 'DeleteWorkers', 'DeleteSelf' or 'DeleteNone'. |||
88
+
|`policy`_[DeletionPolicyType](#deletionpolicytype)_|Policy is the action to take when the condition is met.<br />This field is logically required when using the legacy OnSuccess/OnFailure policies.<br />It is marked as '+optional' at the API level to allow the 'deletionRules' field to be used instead. ||Enum: [DeleteCluster DeleteWorkers DeleteSelf DeleteNone] <br />|
72
89
73
90
74
91
#### DeletionPolicyType
@@ -81,14 +98,51 @@ _Underlying type:_ _string_
81
98
82
99
_Appears in:_
83
100
-[DeletionPolicy](#deletionpolicy)
101
+
-[DeletionRule](#deletionrule)
102
+
103
+
104
+
105
+
#### DeletionRule
84
106
85
107
86
108
109
+
DeletionRule defines a single deletion action and its trigger condition.
110
+
This is the new, recommended way to define deletion behavior.
111
+
112
+
113
+
114
+
_Appears in:_
115
+
-[DeletionStrategy](#deletionstrategy)
116
+
117
+
| Field | Description | Default | Validation |
118
+
| --- | --- | --- | --- |
119
+
|`policy`_[DeletionPolicyType](#deletionpolicytype)_| Policy is the action to take when the condition is met. This field is required. || Enum: [DeleteCluster DeleteWorkers DeleteSelf DeleteNone] <br /> |
120
+
|`condition`_[DeletionCondition](#deletioncondition)_| The condition under which this deletion rule is triggered. This field is required. |||
121
+
122
+
87
123
#### DeletionStrategy
88
124
89
125
90
126
127
+
DeletionStrategy configures automated cleanup after the RayJob reaches a terminal state.
128
+
Two mutually exclusive styles are supported:
129
+
130
+
131
+
Legacy: provide both onSuccess and onFailure (deprecated; removal planned for 1.6.0). May be combined with shutdownAfterJobFinishes and (optionally) global TTLSecondsAfterFinished.
132
+
Rules: provide deletionRules (non-empty list). Rules mode is incompatible with shutdownAfterJobFinishes, legacy fields, and the global TTLSecondsAfterFinished (use per‑rule condition.ttlSeconds instead).
133
+
134
+
135
+
Semantics:
136
+
- A non-empty deletionRules selects rules mode; empty lists are treated as unset.
137
+
- Legacy requires both onSuccess and onFailure; specifying only one is invalid.
138
+
- Global TTLSecondsAfterFinished > 0 requires shutdownAfterJobFinishes=true; therefore it cannot be used with rules mode or with legacy alone (no shutdown).
139
+
- Feature gate RayJobDeletionPolicy must be enabled when this block is present.
140
+
91
141
142
+
Validation:
143
+
- CRD XValidations prevent mixing legacy fields with deletionRules and enforce legacy completeness.
144
+
- Controller logic enforces rules vs shutdown exclusivity and TTL constraints.
145
+
- onSuccess/onFailure are deprecated; migration to deletionRules is encouraged.
|`onSuccess`_[DeletionPolicy](#deletionpolicy)_| OnSuccess is the deletion policy for a successful RayJob.<br />Deprecated: Use `deletionRules` instead for more flexible, multi-stage deletion strategies.<br />This field will be removed in release 1.6.0. |||
155
+
|`onFailure`_[DeletionPolicy](#deletionpolicy)_| OnFailure is the deletion policy for a failed RayJob.<br />Deprecated: Use `deletionRules` instead for more flexible, multi-stage deletion strategies.<br />This field will be removed in release 1.6.0. |||
156
+
|`deletionRules`_[DeletionRule](#deletionrule) array_| DeletionRules is a list of deletion rules, processed based on their trigger conditions.<br />While the rules can be used to define a sequence, if multiple rules are overdue (e.g., due to controller downtime),<br />the most impactful rule (e.g., DeleteSelf) will be executed first to prioritize resource cleanup. || MinItems: 1 <br /> |
102
157
103
158
104
159
@@ -242,7 +297,7 @@ _Appears in:_
242
297
|`clusterSelector`_object (keys:string, values:string)_| clusterSelector is used to select running rayclusters by labels |||
243
298
|`submitterConfig`_[SubmitterConfig](#submitterconfig)_| Configurations of submitter k8s job. |||
244
299
|`managedBy`_string_| ManagedBy is an optional configuration for the controller or entity that manages a RayJob.<br />The value must be either 'ray.io/kuberay-operator' or 'kueue.x-k8s.io/multikueue'.<br />The kuberay-operator reconciles a RayJob which doesn't have this field at all or<br />the field value is the reserved string 'ray.io/kuberay-operator',<br />but delegates reconciling the RayJob with 'kueue.x-k8s.io/multikueue' to the Kueue.<br />The field is immutable. |||
245
-
|`deletionStrategy`_[DeletionStrategy](#deletionstrategy)_| DeletionStrategy indicates what resources of the RayJob and how they are deleted upon job completion.<br />If unset, deletion policy is based on 'spec.shutdownAfterJobFinishes'.<br />This field requires the RayJobDeletionPolicy feature gate to be enabled. |||
300
+
|`deletionStrategy`_[DeletionStrategy](#deletionstrategy)_| DeletionStrategy automates post-completion cleanup.<br />Choose one style or omit:<br /> - Legacy: both onSuccess & onFailure (deprecated; may combine with shutdownAfterJobFinishes and TTLSecondsAfterFinished).<br /> - Rules: deletionRules (non-empty) — incompatible with shutdownAfterJobFinishes, legacy fields, and global TTLSecondsAfterFinished (use per-rule condition.ttlSeconds).<br />Global TTLSecondsAfterFinished > 0 requires shutdownAfterJobFinishes=true.<br />Feature gate RayJobDeletionPolicy must be enabled when this field is set. |||
246
301
|`entrypoint`_string_| Entrypoint represents the command to start execution. |||
247
302
|`runtimeEnvYAML`_string_| RuntimeEnvYAML represents the runtime environment configuration<br />provided as a multi-line YAML string. |||
248
303
|`jobId`_string_| If jobId is not set, a new jobId will be auto-generated. |||
0 commit comments