Skip to content

Commit f805470

Browse files
authored
Merge pull request kubernetes#3195 from gnufied/update-volume-expansion-kep
KEP 284: Add PRR for volume expansion feature
2 parents 090f85c + e74df66 commit f805470

File tree

3 files changed

+277
-2
lines changed

3 files changed

+277
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kep-number: 284
2+
stable:
3+
approver: "@deads2k"

keps/sig-storage/284-enable-volume-expansion/README.md

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
- [PVC API Change](#pvc-api-change)
2222
- [StorageClass API change](#storageclass-api-change)
2323
- [Other API changes](#other-api-changes)
24+
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
25+
- [Feature Enablement and Rollback](#feature-enablement-and-rollback)
26+
- [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
27+
- [Monitoring Requirements](#monitoring-requirements)
28+
- [Dependencies](#dependencies)
29+
- [Scalability](#scalability)
30+
- [Troubleshooting](#troubleshooting)
31+
- [Implementation History](#implementation-history)
32+
- [Drawbacks](#drawbacks)
33+
- [Alternatives](#alternatives)
34+
- [Infrastructure Needed (Optional)](#infrastructure-needed-optional)
2435
<!-- /toc -->
2536

2637
## Release Signoff Checklist
@@ -344,3 +355,252 @@ type StorageClass struct {
344355

345356
This proposal relies on ability to update PVC status from kubelet. While updating PVC's status
346357
a PATCH request must be made from kubelet to update the status.
358+
359+
## Production Readiness Review Questionnaire
360+
361+
### Feature Enablement and Rollback
362+
363+
###### How can this feature be enabled / disabled in a live cluster?
364+
365+
Volume expansion as a feature has been in beta for too long and as a result has gathered
366+
different feature gates that control various aspects of expansion.
367+
368+
- [x] Feature gate (also fill in values in `kep.yaml`)
369+
- Feature gate name: ExpandPersistentVolumes
370+
- description: |
371+
This feature is required for `pvc.Spec.Resources` to be editable and must be
372+
enabled for other expansion related feature gates to work.
373+
- Components depending on the feature gate:
374+
- kube-apiserver
375+
- kubelet
376+
- kube-controller-manager
377+
- Feature gate name: ExpandInUsePersistentVolumes
378+
- description: Enables online expansion. Requires ExpandPersistentVolumes feature gate.
379+
- Components depending on the feature gate:
380+
- kube-apiserver
381+
- kubelet
382+
- kube-controller-manager
383+
- Feature gate name: ExpandCSIVolumes
384+
- description: Enables CSI expansion.
385+
- Components depending on the feature gate:
386+
- kube-apiserver
387+
- kubelet
388+
- kube-controller-manager
389+
- [ ] Other
390+
- Describe the mechanism:
391+
- Will enabling / disabling the feature require downtime of the control
392+
plane?
393+
Enabling/Disabling this feature does not require complete downtime of control-plane
394+
and feature gates can be enabled progressively on different control-plane nodes.
395+
- Will enabling / disabling the feature require downtime or reprovisioning
396+
of a node? (Do not assume `Dynamic Kubelet Config` feature is enabled).
397+
Enabling this feature can be enabled progressively on nodes and as expansion is enabled
398+
on the node then volume expansion will happen on kubelet.
399+
400+
###### Does enabling the feature change any default behavior?
401+
402+
Enabling the feature gate allows users to increase size of pvc by editing `pvc.Spec.Resources` which results
403+
in Kubernetes trying to fulfill the request by actually expanding the volume in controller and then performing
404+
file system or any other kind of expansion needed on the node.
405+
406+
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
407+
408+
Yes - it can be disabled. It just means users can no longer expand their PVCs.
409+
410+
###### What happens if we reenable the feature if it was previously rolled back?
411+
412+
It should be safe to do that. It will just re-enable the feature.
413+
414+
###### Are there any tests for feature enablement/disablement?
415+
416+
There aren't any e2e but there are unit tests that cover this behaviour.
417+
418+
### Rollout, Upgrade and Rollback Planning
419+
420+
###### How can a rollout or rollback fail? Can it impact already running workloads?
421+
422+
The feature gate should not impact existing workloads but since we try to expand the
423+
file system(or perform node-expansion) during volume mount and if expansion fails with
424+
some kind of terminal error then it may prevent mount operation from succeeding.
425+
426+
###### What specific metrics should inform a rollback?
427+
428+
The `volume_mount` operation failure metric - `storage_operation_duration_seconds{operation_name=volume_mount, status=fail-unknown}`
429+
combined with `storage_operation_duration_seconds{operation_name=volume_fs_resize, status=fail-unknown}` should tell us
430+
if expansion is failing on the node and if it is causing mount failures.
431+
432+
Also `csi_sidecar_operations_seconds` and `csi_operations_seconds` metrics with high failure rates for expansion operation should indicate
433+
that expansion is not working in the cluster and hence feature should be rolled back.
434+
435+
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
436+
437+
There are no e2e for upgrade-downgrade-upgrade tests for this specific feature but since volume expansion has been
438+
in beta since 1.11, we have tested the feature manually.
439+
440+
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
441+
442+
This feature does not deprecate any existing features.
443+
444+
### Monitoring Requirements
445+
446+
###### How can an operator determine if the feature is in use by workloads?
447+
448+
A PVC that is being expanded should have `pvc.Status.Conditions` set.
449+
450+
###### How can someone using this feature know that it is working for their instance?
451+
452+
- [x] Events
453+
- Resizing (on PVC)
454+
- Event Reason: External resizer is resizing volume pvc-a71483ed-a5bc-48fa-9151-ca41e7e6634e
455+
- VolumeResizeSuccessful (on PVC)
456+
- Event Reason: Volume resize is successful
457+
- FileSystemResizeSuccessful (on PVC)
458+
- Event Reason: Volume resize is successful. This event is emitted when resizing finishes on kubelet.
459+
- [x API .status
460+
- Condition name:
461+
- Other field:
462+
- [x] Other (treat as last resort)
463+
- Details: `pvc.Status.Capacity` should reflect user requested size after expansion is complete.
464+
465+
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
466+
467+
Enabling this feature should not negatively impact volume mount timings in general cases and hence percentile determined by `storage_operation_duration_seconds{operation_name=volume_mount}` metric should not change.
468+
469+
Having said that if file system requires expansion during mount then it is obviously going to take longer for mount operation to finish.
470+
471+
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
472+
473+
- [ ] Metrics
474+
- controller expansion operation duration:
475+
- Metric name: storage_operation_duration_seconds{operation_name=expand_volume, status=success|fail-unknown}
476+
- [Optional] Aggregation method: percentile
477+
- Components exposing the metric: kube-controller-manager
478+
- node expansion operation duration:
479+
- Metric name: storage_operation_duration_seconds{operation_name=volume_fs_resize, status=success|fail-unknown}
480+
- [Optional] Aggregation method: percentile
481+
- Components exposing the metric: kubelet
482+
- CSI operation metrics in controller:
483+
- Metric name: csi_sidecar_operations_seconds
484+
- [Optional] Aggregation method: percentile
485+
- Components exposing the metric: external-resizer
486+
- CSI operation metrics in kubelet:
487+
- Metric Name: csi_operations_seconds
488+
- [Optional] Aggregation method: percentile
489+
- Components exposing the metric: kubelet
490+
491+
- [ ] Other (treat as last resort)
492+
- Details:
493+
494+
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
495+
All the intree operations from control plane emit `storage_operation_duration_seconds{operation_name=expand_volume, status=success|fail-unknown}` metrics but CSI equivalent from external-resizer is `csi_sidecar_operations_seconds` which will be
496+
documented as alternative if CSI migration is enabled or driver being used is CSI driver.
497+
We don't need to emit new metrics but we do need to document the naming change in metric names.
498+
499+
### Dependencies
500+
501+
<!--
502+
This section must be completed when targeting beta to a release.
503+
-->
504+
505+
###### Does this feature depend on any specific services running in the cluster?
506+
507+
This feature requires external-resizer running in the cluster for CSI volume expansion.
508+
509+
### Scalability
510+
511+
###### Will enabling / using this feature result in any new API calls?
512+
513+
Yes enabling this feature requires new API calls.
514+
515+
- Updates to PVs
516+
- API operations
517+
- PATCH PV
518+
- GET PV
519+
- List PVs
520+
- originating components: kubelet, kube-controller-manager, external-resizer
521+
- resync duration: 10mins (also user configurable)
522+
- Update to PVCs:
523+
- API operations
524+
- PATCH PVC
525+
- GET PVC
526+
- List PVC
527+
- originating components: kubelet, kube-controller-manager, external-resizer
528+
- resync duration: 10mins (also user configurable)
529+
530+
If user enables protection for not expanding PVCs that are in-use, external-resizer will
531+
also watch *all* pods in the cluster. This is an optional flag in external-resizer and generally
532+
only needed when some CSI drivers don't want to handle expansion calls for volumes which are potentially in-use by a pod.
533+
534+
###### Will enabling / using this feature result in introducing new API types?
535+
536+
No
537+
538+
###### Will enabling / using this feature result in any new calls to the cloud provider?
539+
540+
Yes, we expect new calls to modify existing volume objects.
541+
542+
###### Will enabling / using this feature result in increasing size or count of the existing API objects?
543+
544+
Describe them, providing:
545+
- API type(s): PVC
546+
- Estimated increase in size: A PVC with conditions could have its size increased by anywhere between 100 to 250B.
547+
- Estimated amount of new objects: (e.g., new Object X for every existing Pod)
548+
- API type(s): StorageClass
549+
- Estimated increase in size: A StorageClass with `AllowVolumeExpansion` has its size increased by 26bytes almost.
550+
- Estimated amount of new objects: (e.g., new Object X for every existing Pod)
551+
552+
###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?
553+
554+
If expansion happens because of pending file system during mount, then it would increase mount time of volume.
555+
556+
###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
557+
558+
Enabling this feature should not result in resource usage by significant margin, but since we are talking about new controller and an external resize controller for CSI, the resource usage is not negligible either. Having said that - this feature has been in beta since 1.11 and enabled by default(and used in production) - we do not expect resource usage to be a problem.
559+
560+
### Troubleshooting
561+
562+
###### How does this feature react if the API server and/or etcd is unavailable?
563+
Since this feature is user driven and API server or etcd becomes unavailable then users won't be able to expand the PVC.
564+
But if API server becomes unavailable midway through the expansion process then the expansion controller may not be able
565+
save updated PVC in api-server but control-flow is designed to retry and recover from such failures.
566+
567+
###### What are other known failure modes?
568+
569+
- Expansion can be permanently stuck:
570+
- Detection: Check conditions on `pvc.status`
571+
- Mitigations: If expansion is stuck permanently because of issues in backend and can not be recovered then, it requires manual intervention. Steps to recover from expansion failures are documented in - https://kubernetes.io/docs/concepts/storage/persistent-volumes/#recovering-from-failure-when-expanding-volumes
572+
- Diagnostics: Conditions on `pvc.Status` and events on PVC should clearly indicate that expansion is failing.
573+
- Testing: There are some unit tests for failure mode but no e2e.
574+
575+
576+
###### What steps should be taken if SLOs are not being met to determine the problem?
577+
578+
If expansion is affecting pod startup time or causing other issues. It can be disabled by editing storageclass and setting `allowVolumeExpansion` to `false`.
579+
580+
## Implementation History
581+
582+
- 1.8: Alpha
583+
- 1.11: Beta
584+
- 1.24 GA
585+
586+
## Drawbacks
587+
588+
<!--
589+
Why should this KEP _not_ be implemented?
590+
-->
591+
592+
## Alternatives
593+
594+
<!--
595+
What other approaches did you consider, and why did you rule them out? These do
596+
not need to be as detailed as the proposal, but should include enough
597+
information to express the idea and why it was not acceptable.
598+
-->
599+
600+
## Infrastructure Needed (Optional)
601+
602+
<!--
603+
Use this section if you need things from the project/SIG. Examples include a
604+
new subproject, repos requested, or GitHub details. Listing these here allows a
605+
SIG to get the process for these resources started right away.
606+
-->

keps/sig-storage/284-enable-volume-expansion/kep.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,25 @@ see-also:
1919
replaces:
2020
superseded-by:
2121

22-
latest-milestone: "v1.19"
23-
stage: "alpha"
22+
latest-milestone: "v1.24"
23+
stage: "stable"
2424
milestone:
25+
alpha: "v1.8"
2526
beta: "v1.11"
27+
stable: "v1.24"
2628
feature-gates:
2729
- name: ExpandPersistentVolumes
2830
components:
2931
- kube-apiserver
3032
- kubelet
3133
- kube-controller-manager
34+
- name: ExpandInUsePersistentVolumes
35+
components:
36+
- kube-apiserver
37+
- kubelet
38+
- kube-controller-manager
39+
- name: ExpandCSIVolumes
40+
components:
41+
- kube-apiserver
42+
- kubelet
43+
- kube-controller-manager

0 commit comments

Comments
 (0)