Skip to content

Commit 18a5c9f

Browse files
committed
add examples
Signed-off-by: AndySung320 <[email protected]>
1 parent 6fc630f commit 18a5c9f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

kubectl-plugin/pkg/cmd/scale/scale_cluster.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ var (
3535
scaleExample = templates.Examples(`
3636
# Scale a Ray cluster by setting one of its worker groups to 3 replicas
3737
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
3847
`)
3948
)
4049

@@ -184,15 +193,15 @@ func (options *ScaleClusterOptions) Run(ctx context.Context, k8sClient client.Cl
184193
}
185194

186195
// Validate the final state
187-
if finalMaxReplicas > 0 && finalMinReplicas > finalMaxReplicas {
196+
if finalMinReplicas > finalMaxReplicas {
188197
return fmt.Errorf("cannot set --min-replicas (%d) greater than --max-replicas (%d)",
189198
finalMinReplicas, finalMaxReplicas)
190199
}
191200
if finalReplicas < finalMinReplicas {
192201
return fmt.Errorf("cannot set --replicas (%d) smaller than --min-replicas (%d)",
193202
finalReplicas, finalMinReplicas)
194203
}
195-
if finalMaxReplicas > 0 && finalReplicas > finalMaxReplicas {
204+
if finalReplicas > finalMaxReplicas {
196205
return fmt.Errorf("cannot set --replicas (%d) greater than --max-replicas (%d)",
197206
finalReplicas, finalMaxReplicas)
198207
}

0 commit comments

Comments
 (0)