Skip to content

Commit 7d77e95

Browse files
committed
Addressing some more comments
1 parent d9f0744 commit 7d77e95

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

keps/sig-storage/1847-autoremove-statefulset-pvcs/README.md

+14-17
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,9 @@ tags, and then generate with `hack/update-toc.sh`.
9898
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
9999
- [Version Skew Strategy](#version-skew-strategy)
100100
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
101-
- [Scalability](#scalability)
102-
- [Troubleshooting](#troubleshooting)
103101
- [Implementation History](#implementation-history)
104102
- [Drawbacks](#drawbacks)
105103
- [Alternatives](#alternatives)
106-
- [Infrastructure Needed (optional)](#infrastructure-needed-optional)
107104
<!-- /toc -->
108105

109106
## Release Signoff Checklist
@@ -187,7 +184,8 @@ demonstrate the interest in a KEP within the wider Kubernetes community.
187184

188185
### Goals
189186

190-
Provide a feature to auto delete the PVCs created by StatefulSet.
187+
Provide a feature to auto delete the PVCs created by StatefulSet.
188+
Ensure that the pod restarts due to non scale down events such as rolling update or node drain does not delete the PVC.
191189

192190
<!--
193191
List the specific goals of the KEP. What is it trying to achieve? How will we
@@ -223,13 +221,12 @@ The following changes are required:
223221
* Retain - this is the default policy and is considered in cases where no policy is specified.
224222
This would be the existing behaviour - when a StatefulSet is deleted, no action is taken with
225223
respect to the PVCs created by the StatefulSet.
226-
* RemoveOnScaledown - Whenever a pod is deleted, the corresponding PVC is deleted as well.
227-
When a scale down occurs for the StatefulSet, the corresponding PVC is deleted. A scale up
228-
following a scale down, will wait till old PVC for the removed Pod is deleted and ensure
224+
* RemoveOnScaledown - When a pod is deleted on scale down, the corresponding PVC is deleted as well.
225+
A scale up following a scale down, will wait till old PVC for the removed Pod is deleted and ensure
229226
that the PVC used is a freshly created one.
230227
* RemoveOnStatefulSetDeletion - PVCs corresponding to the StatefulSet are deleted when StatefulSet
231228
themselves get deleted.
232-
3. Add `patch` to the statefulset controller cluster role.
229+
3. Add `patch` to the statefulset controller rbac cluster role for `persistentvolumeclaims`.
233230

234231
<!--
235232
This is where we get down to the specifics of what the proposal actually is.
@@ -252,7 +249,7 @@ bogged down.
252249
User environment is such at the content of the PVCs which are created automatically during StatefulSet
253250
creation need not be retained after the StatefulSet is deleted. User also requires that the scale
254251
up/down occurs in a fast manner, and leverages any previously existing auto created PVCs within the
255-
life time of the StatefulSet. A provision needs to be provided for the user to auto-delete the PVCs
252+
life time of the StatefulSet. An option needs to be provided for the user to auto-delete the PVCs
256253
once the StatefulSet is deleted.
257254

258255
User would set the VolumeReclaimPolicy as 'RemoveOnStatefulSetDelete' which would ensure that
@@ -306,20 +303,20 @@ will be added to the StatefulSet. This field represents the user indication on w
306303
associated PVCs can be deleted or not. If this field is not set, the default behaviour is
307304
to leave the PVCs as is during the StatefulSet deletion.
308305

309-
If `VolumeReclaimPolicy` is set to `RemoveOnScaledown` Pod is set as the owner of the PVCs created
310-
from the `VolumeClaimTemplates`. When a Pod is deleted, the PVC owned by the Pod is
311-
also deleted.
306+
If `VolumeReclaimPolicy` is set to `RemoveOnScaledown`, Pod is set as the owner of the PVCs created
307+
from the `VolumeClaimTemplates` just before the scale down is performed by the statefulset controller.
308+
When a Pod is deleted, the PVC owned by the Pod is also deleted.
309+
310+
Current scaleset controller implementation ensures that the manually deleted pods are restored
311+
before the scale down logic is run. This combined with the fact that the owner references are set
312+
only before the scale down will ensure that manual deletions do not automatically delete the PVCs
313+
in question.
312314

313315
During scale-up, if a PVC has an OwnerRef that does not match the Pod, it
314316
potentially indicates that the PVC is referred by the deleted Pod and is in the process of
315317
getting deleted. Controller will exit the current reconcile loop and attempt to reconcile in the
316318
next iteration. This avoids a race with PVC deletion.
317319

318-
Current scaleset controller implementation ensures that the manually deleted pods are restored
319-
before the scale down logic is run. The Pod owner reference is only added to the PVC just
320-
before the scaling down by the controller. This ensures that the manual deletions do not
321-
automatically delete the PVCs in question.
322-
323320
When `VolumeReclaimPolicy` is set to `RemoveOnStatefulSetDeletion` the owner reference in
324321
PVC points to the StatefulSet. When a scale up or down occurs, the PVC would remain the same.
325322
PVCs previously in use before scale down will be used again when the scale up occurs. The PVC deletion

keps/sig-storage/1847-autoremove-statefulset-pvcs/kep.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ authors:
44
- "@kk-src"
55
- "@dsu-igeek"
66
- "@mattcary"
7-
owning-sig: sig-storage
7+
owning-sig: sig-apps
88
participating-sigs:
9-
- sig-apps
9+
- sig-storage
1010
status: provisional
1111
creation-date: 2020-06-04
1212
reviewers:
@@ -39,5 +39,5 @@ milestone:
3939
# the feature come into action, hence not adding additional feature gate.
4040

4141
# The following PRR answers are required at beta release
42-
metrics:
43-
- existing metrics would be enough
42+
# metrics:
43+
# Currently no metrics is planned for alpha release.

0 commit comments

Comments
 (0)