Skip to content

Commit 4327878

Browse files
authored
Merge pull request #459 from gnufied/move-reover-beta-new
Move recover beta new
2 parents ce8f3b7 + 9e436e4 commit 4327878

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

.prow.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#! /bin/bash
2-
2+
# We need to hardcode e2e version for resizer for now, because
3+
# we need fixes from latest release-1.31 branch for all e2es to pass
4+
export CSI_PROW_E2E_VERSION="release-1.31"
35
. release-tools/prow.sh
46
main

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,23 @@ control-plane CSI RPC call or via node CSI RPC call or both as a two step proces
1212

1313
This information reflects the head of this branch.
1414

15-
| Compatible with CSI Version | Container Image | [Min K8s Version](https://kubernetes-csi.github.io/docs/kubernetes-compatibility.html#minimum-version) | [Recommended K8s Version](https://kubernetes-csi.github.io/docs/kubernetes-compatibility.html#recommended-version) |
16-
| ------------------------------------------------------------------------------------------ | -------------------------------| --------------- | ------------- |
17-
| [CSI Spec v1.10.0](https://github.com/container-storage-interface/spec/releases/tag/v1.5.0) | k8s.gcr.io/sig-storage/csi-resizer | 1.16 | 1.31 |
15+
| Compatible with CSI Version | Container Image | [Min K8s Version](https://kubernetes-csi.github.io/docs/kubernetes-compatibility.html#minimum-version) | [Recommended K8s Version](https://kubernetes-csi.github.io/docs/kubernetes-compatibility.html#recommended-version) |
16+
|---------------------------------------------------------------------------------------------|------------------------------------|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
17+
| [CSI Spec v1.10.0](https://github.com/container-storage-interface/spec/releases/tag/v1.5.0) | k8s.gcr.io/sig-storage/csi-resizer | 1.16 | 1.32 |
1818

1919
## Feature status
2020

2121
Various external-resizer releases come with different alpha / beta features.
2222

2323
The following table reflects the head of this branch.
2424

25-
| Feature | Status | Default | Description |
26-
| ---------------------- |--------| ------- | ----------------------------------------------------------------------------------------------------------------------------- |
27-
| VolumeExpansion | Stable | On | [Support for expanding CSI volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#csi-volume-expansion). |
28-
| ReadWriteOncePod | Stable | On | [Single pod access mode for PersistentVolumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes). |
29-
| VolumeAttributesClass | Beta | Off | [Volume Attributes Classes](https://kubernetes.io/docs/concepts/storage/volume-attributes-classes). |
25+
| Feature | Status | Default | Description |
26+
|-------------------------------|--------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
27+
| VolumeExpansion | Stable | On | [Support for expanding CSI volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#csi-volume-expansion). |
28+
| ReadWriteOncePod | Stable | On | [Single pod access mode for PersistentVolumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes). |
29+
| RecoverVolumeExpansionFailure | Beta | On | [Recover from volume expansion failure](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#recovering-from-failure-when-expanding-volumes) |
30+
| VolumeAttributesClass | Beta | Off | [Volume Attributes Classes](https://kubernetes.io/docs/concepts/storage/volume-attributes-classes). |
31+
3032

3133
## Usage
3234

@@ -78,12 +80,12 @@ Note that the external-resizer does not scale with more replicas. Only one exter
7880
* `AnnotateFsResize=true|false` (ALPHA - default=false): Store current size of pvc in pv's annotation, so as if pvc is deleted while expansion was pending on the node, the size of pvc can be restored to old value. This permits
7981
expansion on the node in case pvc was deleted while expansion was pending on the node (but completed in the controller). Use of this feature depends on Kubernetes version 1.21.
8082

81-
* `RecoverVolumeExpansionFailure=true|false` (ALPHA - default=false): Allow users to reduce size of PVC if expansion to current size is failing. If the feature gate `RecoverVolumeExpansionFailure` is enabled
83+
* `RecoverVolumeExpansionFailure=true|false` (BETA - default=true): Allow users to reduce size of PVC if expansion to current size is failing. If the feature gate `RecoverVolumeExpansionFailure` is enabled
8284
and expansion has failed for a PVC, you can retry expansion with a smaller size than the previously requested value. To request a new expansion attempt with a
8385
smaller proposed size, edit `.spec.resources` for that PVC and choose a value that is less than the value you previously tried.
8486
This is useful if expansion to a higher value did not succeed because of capacity constraint.
8587
If that has happened, or you suspect that it might have, you can retry expansion by specifying a
86-
size that is within the capacity limits of underlying storage provider. You can monitor status of resize operation by watching `.status.resizeStatus` and events on the PVC. Use of this feature-gate requires Kubernetes 1.31.
88+
size that is within the capacity limits of underlying storage provider. You can monitor status of resize operation by watching `.status.resizeStatus` and events on the PVC. Use of this feature-gate requires Kubernetes 1.32.
8789

8890

8991
#### Other recognized arguments

pkg/controller/expand_and_recover.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,20 @@ func (ctrl *resizeController) expandAndRecover(pvc *v1.PersistentVolumeClaim, pv
130130
newSize = *allocatedSize
131131
}
132132
default:
133-
// It is impossible for ResizeStatus to be empty and allocatedSize to be not nil but somehow
133+
// Usually it is impossible for ResizeStatus to be empty and allocatedSize to be not nil but somehow
134134
// if we do end up in this state, it is safest to resume expansion to last recorded size in
135135
// allocatedSize variable.
136+
// This can also happen if external-resizer is running with a version of api-server
137+
// which has volume recovery feature disabled.
136138
if resizeStatus == "" && allocatedSize != nil {
137139
newSize = *allocatedSize
138140
} else {
141+
klog.Warningf("external-resizer may be running with older version of kubernetes api-server, please upgrade to k8s version 1.32")
142+
// Usually resize operations are idempotent and it should be safe to reque resize here, but skipping expansion of already
143+
// expanded volumes saves some CPU cycles and helps in keeping e2es happy when running against older versions of kube-apiserver
144+
if util.HasFileSystemResizePendingCondition(pvc) {
145+
return pvc, pv, nil, false
146+
}
139147
newSize = pvcSpecSize
140148
}
141149
}

pkg/features/features.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const (
2828

2929
// owner: @gnufied
3030
// alpha: v1.23
31+
// beta: v1.32
3132
//
3233
// Allows users to recover from volume expansion failures
3334
RecoverVolumeExpansionFailure featuregate.Feature = "RecoverVolumeExpansionFailure"
@@ -47,6 +48,6 @@ func init() {
4748

4849
var defaultResizerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
4950
AnnotateFsResize: {Default: false, PreRelease: featuregate.Alpha},
50-
RecoverVolumeExpansionFailure: {Default: false, PreRelease: featuregate.Alpha},
51+
RecoverVolumeExpansionFailure: {Default: true, PreRelease: featuregate.Beta},
5152
VolumeAttributesClass: {Default: false, PreRelease: featuregate.Beta},
5253
}

0 commit comments

Comments
 (0)