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: kubernetes/README.md
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -411,6 +411,14 @@ Apply the pool configuration:
411
411
kubectl apply -f pool-example.yaml
412
412
```
413
413
414
+
**Optional: Configure scale rate control** - Add `scaleStrategy` to limit the pace of scaling:
415
+
```yaml
416
+
scaleStrategy:
417
+
maxUnavailable: "20%"# or absolute number like 5
418
+
```
419
+
420
+
This controls how many pods can be unavailable during scaling. For example, with `poolMax=50` and `maxUnavailable=20%`, at most 10 pods will be scaled at once.
421
+
414
422
Create a batch of sandboxes using the pool:
415
423
416
424
```yaml
@@ -428,6 +436,53 @@ Apply the batch sandbox configuration:
428
436
kubectl apply -f pooled-batch-sandbox.yaml
429
437
```
430
438
439
+
##### Pooled Sandbox with Scale Rate Control
440
+
441
+
The Pool supports configurable scale rate control through `scaleStrategy`, which limits the pace of scaling operations to prevent resource contention:
442
+
443
+
```yaml
444
+
apiVersion: sandbox.opensandbox.io/v1alpha1
445
+
kind: Pool
446
+
metadata:
447
+
name: scale-controlled-pool
448
+
spec:
449
+
template:
450
+
spec:
451
+
containers:
452
+
- name: sandbox-container
453
+
image: nginx:latest
454
+
ports:
455
+
- containerPort: 80
456
+
capacitySpec:
457
+
bufferMax: 20
458
+
bufferMin: 5
459
+
poolMax: 50
460
+
poolMin: 10
461
+
scaleStrategy:
462
+
# MaxUnavailable controls the maximum number of pods that can be unavailable during scaling.
463
+
# Can be an absolute number (ex: 5) or a percentage of desired pods (ex: "10%").
464
+
# Defaults to 25% if not specified.
465
+
maxUnavailable: "20%"
466
+
```
467
+
468
+
**ScaleStrategy parameters:**
469
+
470
+
- **maxUnavailable**: Specifies the maximum number of pods that can be unavailable during scaling operations. This can be:
471
+
- An absolute number (e.g., `5` means at most 5 pods can be unavailable at once)
472
+
- A percentage string (e.g., `"10%"` means at most 10% of desired pods can be unavailable)
473
+
- Defaults to `25%` if not specified
474
+
475
+
**Use cases:**
476
+
477
+
- **Prevent resource contention**: Limit scaling pace to avoid overwhelming the cluster with simultaneous pod creation/deletion
478
+
- **Gradual scaling**: Ensure smooth scaling transitions by capping the rate of change
479
+
- **Production stability**: Protect production workloads from aggressive scaling that might impact service quality
480
+
481
+
Apply the pool configuration:
482
+
```sh
483
+
kubectl apply -f pool-with-scale-strategy.yaml
484
+
```
485
+
431
486
##### Pooled Sandbox With Heterogeneous Tasks
432
487
Create a batch of sandboxes with process-based heterogeneous tasks. For task execution to work properly, the task-executor must be deployed as a sidecar container in the pool template and share the process namespace with the sandbox container:
pod, err:=utils.GetPodFromTemplate(pool.Spec.Template, pool, metav1.NewControllerRef(pool, sandboxv1alpha1.SchemeBuilder.GroupVersion.WithKind("Pool")))
0 commit comments