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
// the volume is equally accessible from all nodes in the cluster and
392
430
// MAY schedule workloads referencing the volume on any available
393
-
// node.
431
+
// node.
394
432
//
395
433
// SP MUST only set this field if allow_topology_updates is set
396
434
// in the request. SP SHOULD fail the request if it needs to update
397
435
// topology but is not allowed by CO.
436
+
//
437
+
// SP SHOULD only return topology that is a super-set of the
438
+
// original topology to avoid race conditions when scheduling.
398
439
repeated Topology accessible_topology = 1;
399
440
400
441
// Indicates whether the modification is still in progress.
@@ -422,42 +463,6 @@ But this KEP does not cover the automatic correction. Kubernetes should only ret
422
463
423
464
Scheduler Enhancements: make sure the Pod is re-queued when the PV is updated.
424
465
425
-
A typical workflow is (taking the user story 1 as an example):
426
-
1. User create a `VolumeAttributeClass`:
427
-
```yaml
428
-
apiVersion: storage.k8s.io/v1beta1
429
-
kind: VolumeAttributesClass
430
-
metadata:
431
-
name: regional
432
-
driverName: csi.provider.com
433
-
parameters:
434
-
type: regional
435
-
```
436
-
2. User modify the `volumeAttributesClassName` in the PVC to `regional`
437
-
3. external-resizer initiate ControllerModifyVolume with `allow_topology_updates` set to true, `mutable_parameters` set to `{"type": "regional"}`
438
-
4. CSI driver blocks until the modification finished, then return with `accessible_topology` set to `[{"topology.kubernetes.io/region": "cn-beijing"}]`
439
-
5. external-resizer sets `PersistentVolume.spec.nodeAffinity` accordingly, then update the PV status to indicate the modification is successful.
440
-
441
-
If it takes long to modify the volume, the new topology is not strictly less restrictive,
442
-
and SP wants to minimize the time window of the race condition (taking the user story 2 as an example):
443
-
1. User create a `VolumeAttributeClass`:
444
-
```yaml
445
-
apiVersion: storage.k8s.io/v1beta1
446
-
kind: VolumeAttributesClass
447
-
metadata:
448
-
name: essd
449
-
driverName: csi.provider.com
450
-
parameters:
451
-
type: cloud_essd
452
-
```
453
-
2. User modify the `volumeAttributesClassName` in the PVC to `essd`
454
-
3. external-resizer initiate ControllerModifyVolume with `allow_topology_updates` set to true, `mutable_parameters` set to `{"type": "cloud_essd"}`
455
-
4. CSI driver returns with `in_progress` set to true, and `accessible_topology` set to `[{"provider.com/disktype.cloud_essd": "available"}]`
456
-
5. external-resizer sets `PersistentVolume.spec.nodeAffinity` accordingly, but the PV status is not updated yet.
457
-
From now on, the new Pod will be scheduled to nodes with `provider.com/disktype.cloud_essd: available`,
458
-
maybe they will stuck in `ContainerCreating` state until the modification finishes.
459
-
6. external-resizer go back to step 3, retries until `in_progress` is set to false.
460
-
7. external-resizer update the PV status to indicate the modification is successful.
0 commit comments