Skip to content

Commit e23b658

Browse files
committed
add typical workflow
1 parent 487defd commit e23b658

File tree

1 file changed

+38
-0
lines changed
  • keps/sig-storage/5381-mutable-pv-affinity

1 file changed

+38
-0
lines changed

keps/sig-storage/5381-mutable-pv-affinity/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,44 @@ But this KEP does not cover the automatic correction. Kubernetes should only ret
422422

423423
Scheduler Enhancements: make sure the Pod is re-queued when the PV is updated.
424424

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.
461+
462+
425463
### Test Plan
426464

427465
<!--

0 commit comments

Comments
 (0)