|
35 | 35 | scaleExample = templates.Examples(` |
36 | 36 | # Scale a Ray cluster by setting one of its worker groups to 3 replicas |
37 | 37 | kubectl ray scale cluster my-cluster --worker-group my-group --replicas 3 |
| 38 | +
|
| 39 | + # Increase the maximum replicas for a worker group to 10 |
| 40 | + kubectl ray scale cluster my-cluster --worker-group my-group --max-replicas 10 |
| 41 | +
|
| 42 | + # Set both minimum and maximum replicas for a worker group |
| 43 | + kubectl ray scale cluster my-cluster --worker-group my-group --min-replicas 2 --max-replicas 6 |
| 44 | +
|
| 45 | + # Scale the worker group to 5 replicas and update its min and max bounds at the same time |
| 46 | + kubectl ray scale cluster my-cluster --worker-group my-group --replicas 5 --min-replicas 3 --max-replicas 7 |
38 | 47 | `) |
39 | 48 | ) |
40 | 49 |
|
@@ -184,15 +193,15 @@ func (options *ScaleClusterOptions) Run(ctx context.Context, k8sClient client.Cl |
184 | 193 | } |
185 | 194 |
|
186 | 195 | // Validate the final state |
187 | | - if finalMaxReplicas > 0 && finalMinReplicas > finalMaxReplicas { |
| 196 | + if finalMinReplicas > finalMaxReplicas { |
188 | 197 | return fmt.Errorf("cannot set --min-replicas (%d) greater than --max-replicas (%d)", |
189 | 198 | finalMinReplicas, finalMaxReplicas) |
190 | 199 | } |
191 | 200 | if finalReplicas < finalMinReplicas { |
192 | 201 | return fmt.Errorf("cannot set --replicas (%d) smaller than --min-replicas (%d)", |
193 | 202 | finalReplicas, finalMinReplicas) |
194 | 203 | } |
195 | | - if finalMaxReplicas > 0 && finalReplicas > finalMaxReplicas { |
| 204 | + if finalReplicas > finalMaxReplicas { |
196 | 205 | return fmt.Errorf("cannot set --replicas (%d) greater than --max-replicas (%d)", |
197 | 206 | finalReplicas, finalMaxReplicas) |
198 | 207 | } |
|
0 commit comments