|
16 | 16 | - [Case 2 (node only expandable volume):](#case-2-node-only-expandable-volume)
|
17 | 17 | - [Case 3 (Malicious user)](#case-3-malicious-user)
|
18 | 18 | - [Case 4(Malicious User and rounding to GB/GiB bounaries)](#case-4malicious-user-and-rounding-to-gbgib-bounaries)
|
| 19 | + - [Case 5(Rapid successive expansion and shrink)](#case-5rapid-successive-expansion-and-shrink) |
19 | 20 | - [Risks and Mitigations](#risks-and-mitigations)
|
20 | 21 | - [Graduation Criteria](#graduation-criteria)
|
21 | 22 | - [Test Plan](#test-plan)
|
@@ -123,7 +124,7 @@ When user reduces `pvc.Spec.Resources`, expansion-controller will set `pvc.Statu
|
123 | 124 |
|
124 | 125 | 1. If `pvc.Status.ResizeStatus` is `ControllerExpansionFailed` (indicating that previous expansion to last known `allocatedResources` failed with a final error) and previous control-plane has not succeeded.
|
125 | 126 | 2. If `pvc.Status.ResizeStatus` is `NodeExpansionFailed` and SP supports node-only expansion (indicating that previous expansion to last known `allocatedResources` failed on node with a final error).
|
126 |
| -3. If `pvc.Status.ResizeStatus` is `nil` or `empty` and previous `ControllerExpandVolume** has not succeeded. |
| 127 | +3. If `pvc.Status.ResizeStatus` is `nil` or `empty` and previous `ControllerExpandVolume` has not succeeded. |
127 | 128 |
|
128 | 129 | 
|
129 | 130 |
|
@@ -202,6 +203,24 @@ The complete expansion and recovery flow of both control-plane and kubelet is do
|
202 | 203 | - Although `pvc.Spec.Resources` reports size as `10.5GB`, expansion to `10.5GB` is never attempted.
|
203 | 204 | - Quota controller sees no change in storage usage by the PVC because `pvc.Status.AllocatedResources` is 100Gi.
|
204 | 205 |
|
| 206 | +##### Case 5(Rapid successive expansion and shrink) |
| 207 | +- User increases 10Gi PVC to 100Gi by changing `pvc.spec.resources.requests["storage"] = "100Gi"` |
| 208 | +- Quota controller uses `max(pvc.Status.AllocatedResources, pvc.Spec.Resources)` and adds `90Gi` to used quota. |
| 209 | +- Expansion controller slowly starts expanding the volume and sets `pvc.Status.AllocatedResources` to `100Gi` (before expanding). |
| 210 | +- Expansion controller also sets `pvc.Status.ResizeStatus` to `ControllerExpansionInProgress`. |
| 211 | +- At this point -`pv.Spec.Capacity` and `pvc.Status.Capacity` stays at 10Gi until the resize is finished. |
| 212 | +- While the storage backend is re-sizing the volume, user requests size 200Gi by changing `pvc.spec.resources.requests["storage"] = "200Gi"` |
| 213 | +- Quota controller uses `max(pvc.Status.AllocatedResources, pvc.Spec.Resources)` and adds `100Gi` to used quota. |
| 214 | +- Since `pvc.Status.ResizeStatus` is in `ControllerExpansionInProgress` - expansion controller still chooses last `pvc.Status.AllocatedResources` as new size. |
| 215 | +- User reduces size back to `20Gi`. |
| 216 | +- Quota controller uses `max(pvc.Status.AllocatedResources, pvc.Spec.Resources)` and *returns* `100Gi` to used quota. |
| 217 | +- Expansion controller notices that previous expansion to last known `allocatedresources` is still in-progress. |
| 218 | +- Expansion controller keeps expanding the volume to `allocatedResources`. |
| 219 | +- Expansion to `100G` succeeds and `pv.Spec.Capacity` and `pvc.Status.Capacity` report new size as `100G`. |
| 220 | +- Although `pvc.Spec.Resources` reports size as `20G`, expansion to `20G` is never attempted. |
| 221 | +- Quota controller sees no change in storage usage by the PVC because `pvc.Status.AllocatedResources` is 100Gi. |
| 222 | + |
| 223 | + |
205 | 224 | ### Risks and Mitigations
|
206 | 225 |
|
207 | 226 | - Once expansion is initiated, the lowering of requested size is only allowed upto a value *greater* than `pvc.Status`. It is not possible to entirely go back to previously requested size. This should not be a problem however in-practice because user can retry expansion with slightly higher value than `pvc.Status` and still recover from previously failing expansion request.
|
|
0 commit comments