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
-[extensively validate the updated <code>volumeClaimTemplate</code>](#extensively-validate-the-updated-volumeclaimtemplate)
111
-
-[Only support for updating <code>volumeClaimTemplate.spec.resources.requests.storage</code>](#only-support-for-updating-volumeclaimtemplatespecresourcesrequestsstorage)
110
+
-[Extensively validate the updated <code>volumeClaimTemplates</code>](#extensively-validate-the-updated-volumeclaimtemplates)
111
+
-[Only support for updating storage size](#only-support-for-updating-storage-size)
Kubernetes does not support the modification of the `volumeClaimTemplate` of a StatefulSet currently.
179
-
This enhancement proposes to support arbitrary modifications to the `volumeClaimTemplate`,
178
+
Kubernetes does not support the modification of the `volumeClaimTemplates` of a StatefulSet currently.
179
+
This enhancement proposes to support arbitrary modifications to the `volumeClaimTemplates`,
180
180
automatically updating the associated PersistentVolumeClaim objects in-place if applicable.
181
181
Currently, PVC `spec.resources.requests.storage` and `spec.volumeAttributesClassName`
182
182
fields can be updated in-place.
@@ -211,7 +211,7 @@ This brings many headaches in a continuously evolving environment.
211
211
List the specific goals of the KEP. What is it trying to achieve? How will we
212
212
know that this has succeeded?
213
213
-->
214
-
* Allow users to update the `volumeClaimTemplate` of a `StatefulSet` in place.
214
+
* Allow users to update the `volumeClaimTemplates` of a `StatefulSet` in place.
215
215
* Automatically update the associated PersistentVolumeClaim objects in-place if applicable.
216
216
* Support updating PersistentVolumeClaim objects with `OnDelete` strategy.
217
217
* Coordinate updates to `Pod` and PersistentVolumeClaim objects.
@@ -224,7 +224,7 @@ What is out of scope for this KEP? Listing non-goals helps to focus discussion
224
224
and make progress.
225
225
-->
226
226
* Support automatic rolling update of PersistentVolumeClaim.
227
-
* Validate the updated `volumeClaimTemplate` as how PVC update does.
227
+
* Validate the updated `volumeClaimTemplates` as how PVC update does.
228
228
* Update ephemeral volumes.
229
229
230
230
@@ -238,7 +238,7 @@ implementation. What is the desired outcome and how do we measure success?.
238
238
The "Design Details" section below is for the real
239
239
nitty-gritty.
240
240
-->
241
-
1. Change API server to allow any updates to `volumeClaimTemplate` of a StatefulSet.
241
+
1. Change API server to allow any updates to `volumeClaimTemplates` of a StatefulSet.
242
242
243
243
2. Modify StatefulSet controller to add PVC reconciliation logic.
244
244
@@ -283,7 +283,7 @@ both for in-place update and for the PVCs that need manual intervention.
283
283
284
284
How to update PVCs:
285
285
1. If `volumeClaimUpdateStrategy` is `InPlace`,
286
-
and if `volumeClaimTemplate` and actual PVC only differ in mutable fields
286
+
and if `volumeClaimTemplates` and actual PVC only differ in mutable fields
287
287
(`spec.resources.requests.storage`, `spec.volumeAttributesClassName`, `metadata.labels`, and `metadata.annotations` currently),
288
288
update the PVC in-place to the extent possible.
289
289
Do not perform the update that will be rejected by API server, such as
@@ -299,14 +299,14 @@ Tested on Kubernetes v1.28, and I can see this event:
299
299
Warning FailedCreate 3m58s (x7 over 3m58s) statefulset-controller create Pod test-rwop-0 in StatefulSet test-rwop failed error: pvc data-test-rwop-0 is being deleted
300
300
-->
301
301
302
-
3. Use either current or updated revision of the `volumeClaimTemplate` to create/update the PVC,
302
+
3. Use either current or updated revision of the `volumeClaimTemplates` to create/update the PVC,
303
303
just like Pod template.
304
304
305
305
When to update PVCs:
306
306
1. If `volumeClaimSyncStrategy` is `LockStep`,
307
307
before advancing `status.updatedReplicas` to the next replica,
308
308
additionally check that the PVCs of the next replica are
309
-
[compatible](#what-pvc-is-compatible) with the new `volumeClaimTemplate`.
309
+
[compatible](#what-pvc-is-compatible) with the new `volumeClaimTemplates`.
310
310
If not, and we are not going to update it in-place automatically,
311
311
wait for the user to delete/update the old PVC manually.
312
312
@@ -336,7 +336,7 @@ Failure cases: don't left too many PVCs being updated in-place. We expect to upd
336
336
We should update status, just like what we do when waiting for Pod to be ready.
337
337
We should block the update process if the PVC is never compatible.
338
338
339
-
- If the `volumeClaimTemplate` is updated again when the previous rollout is blocked,
339
+
- If the `volumeClaimTemplates` is updated again when the previous rollout is blocked,
340
340
similar to [Pods](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#forced-rollback),
341
341
user may need to manually deal with the blocking PVCs (update or delete them).
342
342
@@ -372,7 +372,7 @@ All the test, review, approval, and rollback process can be reused.
372
372
We decide to switch from home-made local storage to the storage provided by a cloud provider.
373
373
We can not afford any downtime, so we don't want to delete and recreate the StatefulSet.
374
374
Our app can automatically rebuild the data in the new storage from other replicas.
375
-
So we update the `volumeClaimTemplate` of the StatefulSet,
375
+
So we update the `volumeClaimTemplates` of the StatefulSet,
376
376
delete the PVC and Pod of one replica, let the controller re-create them,
377
377
then monitor the rebuild process.
378
378
Once the rebuild completes successfully, we proceed to the next replica.
@@ -395,7 +395,7 @@ The same process as Story 2 can be used.
395
395
396
396
The storage requirement of different replicas are not identical,
397
397
so we still want to update each PVC manually and separately.
398
-
Possibly we also update the `volumeClaimTemplate` for new replicas,
398
+
Possibly we also update the `volumeClaimTemplates` for new replicas,
399
399
but we don't want the controller to interfere with the existing replicas.
400
400
401
401
### Notes/Constraints/Caveats (Optional)
@@ -413,20 +413,20 @@ we wait for the PVC to be compatible whenever we would wait for the Pod to be re
413
413
414
414
`volumeClaimSyncStrategy` is introduce to keep capability of current deployed workloads.
415
415
StatefulSet currently accepts and uses existing PVCs that is not created by the controller,
416
-
So the `volumeClaimTemplate` and PVC can differ even before this enhancement.
416
+
So the `volumeClaimTemplates` and PVC can differ even before this enhancement.
417
417
Some users may choose to keep the PVCs of different replicas different.
418
418
We should not block the Pod updates for them.
419
419
420
420
If `volumeClaimSyncStrategy` is `Async`,
421
-
we just ignore the PVCs that cannot be updated to be compatible with the new `volumeClaimTemplate`,
421
+
we just ignore the PVCs that cannot be updated to be compatible with the new `volumeClaimTemplates`,
422
422
as what we do currently.
423
423
Of course, we report this in the status of the StatefulSet.
424
424
425
425
However, a workload may rely on some features provided by a specific PVC,
426
426
So we should provide a way to coordinate the update.
427
427
That's why we also need `LockStep`.
428
428
429
-
The StatefulSet controller should also keeps the current and updated revision of the `volumeClaimTemplate`,
429
+
The StatefulSet controller should also keeps the current and updated revision of the `volumeClaimTemplates`,
430
430
so that a `LockStep` StatefulSet can still re-create Pods and PVCs that are yet-to-be-updated.
431
431
432
432
### Risks and Mitigations
@@ -1006,29 +1006,30 @@ What other approaches did you consider, and why did you rule them out? These do
1006
1006
not need to be as detailed as the proposal, but should include enough
1007
1007
information to express the idea and why it was not acceptable.
1008
1008
-->
1009
-
### extensively validate the updated `volumeClaimTemplate`
1009
+
### Extensively validate the updated `volumeClaimTemplates`
1010
1010
1011
-
[KEP-0661] proposes that we should do extensive validation on the updated `volumeClaimTemplate`.
1011
+
[KEP-0661] proposes that we should do extensive validation on the updated `volumeClaimTemplates`.
1012
1012
e.g., prevent decreasing the storage size, preventing expand if the storage class does not support it.
1013
1013
However, this have saveral drawbacks:
1014
-
* Not reverting the `volumeClaimTemplate` when rollback the StatefulSet is confusing,
1014
+
* Not reverting the `volumeClaimTemplates` when rollback the StatefulSet is confusing,
1015
1015
* The validation can be a barrier when recovering from a failed update.
1016
1016
If RecoverVolumeExpansionFailure feature gate is enabled, we can recover from failed expansion by decreasing the size.
1017
1017
* The validation is racy, especially when recovering from failed expansion.
1018
1018
We still need to consider most abnormal cases even we do those validations.
1019
1019
* This does not match the pattern of existing behaviors.
1020
1020
That is, the controller should take the expected state, retry as needed to reach that state.
1021
1021
For example, StatefulSet will not reject a invalid `serviceAccountName`.
1022
-
*`volumeClaimTemplate` is also used when creating new PVCs, so even if the existing PVCs cannot be updated,
1022
+
*`volumeClaimTemplates` is also used when creating new PVCs, so even if the existing PVCs cannot be updated,
1023
1023
a user may still want to affect new PVCs.
1024
1024
1025
-
### Only support for updating `volumeClaimTemplate.spec.resources.requests.storage`
1025
+
### Only support for updating storage size
1026
1026
1027
-
[KEP-0661] only enables expanding the volume. However, because the StatefulSet can take pre-existing PVCs,
1027
+
[KEP-0661] only enables expanding the volume by updating `volumeClaimTemplates[*].spec.resources.requests.storage`.
1028
+
However, because the StatefulSet can take pre-existing PVCs,
1028
1029
we still need to consider what to do when template and PVC don't match.
1029
1030
The complexity of this proposal will not decrease much if we only support expanding the volume.
1030
1031
1031
-
By enabling arbitrary updating to the `volumeClaimTemplate`,
1032
+
By enabling arbitrary updating to the `volumeClaimTemplates`,
1032
1033
we just acknowledge and officially support this use case.
0 commit comments