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: keps/sig-storage/5381-mutable-pv-affinity/README.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -422,6 +422,44 @@ But this KEP does not cover the automatic correction. Kubernetes should only ret
422
422
423
423
Scheduler Enhancements: make sure the Pod is re-queued when the PV is updated.
424
424
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