Skip to content

Commit 20bddcf

Browse files
author
Traci Morrison
committed
Documenting how to prevent PVC deletion if the PVC is in use by a pod
1 parent b870b11 commit 20bddcf

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

_topic_map.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ Topics:
395395
Distros: openshift-origin,openshift-enterprise
396396
- Name: Configuring for VMWare vSphere
397397
File: configuring_vsphere
398-
- Name: Configuring for local Volume
398+
- Name: Configuring for Local Volume
399399
File: configuring_local
400400
- Name: Configuring for Persistent Volume Claim Protection
401401
File: configuring_pvc_protection

architecture/additional_concepts/storage.adoc

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,21 @@ PVs by including a `persistentVolumeClaim` in their pod's volumes block. See
107107
xref:pvc-claims-as-volumes[below] for syntax details.
108108

109109
[[pvcprotection]]
110-
111110
=== Persistent Volume Claim Protection
112111

113112
[NOTE]
114113
====
115-
Persistent Volume Claim Protection is an alpha feature and may change in a future release of {product-title}.
114+
PVC protection is an alpha feature and may change in a future release of {product-title}.
116115
====
117116

118-
The purpose of the PVC protection is to ensure that PVCs in active use by a pod are not removed from the system as this may result in data loss.
117+
The purpose of PVC protection is to ensure that PVCs in active use by a pod are not removed from the system, as this may result in data loss.
119118

120119
[NOTE]
121120
====
122-
PVC is in active use by a pod when the the pod status is `Pending` and the pod is assigned to a node or the pod status is `Running`.
121+
A PVC is in active use by a pod when the the pod status is `Pending`, and the pod is assigned to a node or the pod status is `Running`.
123122
====
124123

125-
When the PVC protection feature is enabled, if a user deletes a PVC in active use by a pod, the PVC is not removed immediately. PVC removal is postponed until the PVC is no longer actively used by any pods.
124+
When the PVC protection feature is enabled, if a user deletes a PVC in active use by a pod, the PVC is not immediately removed. PVC removal is postponed until the PVC is no longer actively used by any pods.
126125

127126
You can see that a PVC is protected when the PVC's status is `Terminating` and the `Finalizers` list includes `kubernetes.io/pvc-protection`:
128127
[source, shell]
@@ -140,9 +139,9 @@ Finalizers: [kubernetes.io/pvc-protection]
140139
...
141140
----
142141

142+
To enable PVC protection, see xref:../../install_config/configuring_pvc_protection.adoc#install-config-configuring-pvc-protection[Configuring Persistent Volume Claim Protection].
143143

144144
[[releasing]]
145-
146145
=== Releasing
147146

148147
When a user is done with a volume, they can delete the PVC object from the API
@@ -173,7 +172,7 @@ If supported by appropriate volume plug-in, recycling performs a basic scrub (`r
173172

174173
[WARNING]
175174
====
176-
The `recycle` reclaim policy is deprecated in favor of dynamic provisioning and it will be removed in future releases.
175+
The `recycle` reclaim policy is deprecated in favor of dynamic provisioning and is removed starting in {product-title} 3.6.
177176
====
178177

179178
ifdef::openshift-origin,openshift-enterprise[]
@@ -290,7 +289,7 @@ Future attributes may include IOPS, throughput, etc.
290289
=== Access Modes
291290

292291
A `PersistentVolume` can be mounted on a host in any way supported by the
293-
resource provider. Providers will have different capabilities and each PV's
292+
resource provider. Providers have different capabilities and each PV's
294293
access modes are set to the specific modes supported by that particular volume.
295294
For example, NFS can support multiple read/write clients, but a specific NFS PV
296295
might be exported on the server as read-only. Each PV gets its own set of access
@@ -352,7 +351,7 @@ Before draining the node, first ensure the pods that use these volumes are
352351
deleted.
353352
====
354353

355-
The table below lists the access modes supported by different persistent volumes:
354+
The table below lists the access modes supported by different PVs:
356355

357356
.Supported Access Modes for Persistent Volumes
358357
[cols=",^v,^v,^v", width="100%",options="header"]
@@ -382,7 +381,7 @@ ifdef::openshift-dedicated,openshift-online[]
382381

383382
=== {product-title} Restrictions
384383

385-
The following restrictions apply when using persistent volumes with {product-title}:
384+
The following restrictions apply when using PVs with {product-title}:
386385
endif::[]
387386

388387
ifdef::openshift-dedicated[]
@@ -405,7 +404,7 @@ ifdef::openshift-online[]
405404
** VOLUME directive without a mapped external volume fails to be instantiated.
406405
* *emptyDir* is restricted to 512 Mi per project (group) per node.
407406
** If there is a single pod for a project on a particular node, then the pod can consume up to 512 Mi of *emptyDir* storage.
408-
** If there are multiple pods for a project on a particular node, then those pods will share the 512 Mi of *emptyDir* storage.
407+
** If there are multiple pods for a project on a particular node, then those pods share the 512 Mi of *emptyDir* storage.
409408
* *emptyDir* has the same lifecycle as the pod:
410409
** *emptyDir* volumes survive container crashes/restarts.
411410
** *emptyDir* volumes are deleted when the pod is deleted.
@@ -439,7 +438,7 @@ Currently, only NFS and HostPath support the 'Recycle' reclaim policy.
439438

440439
[WARNING]
441440
====
442-
The `recycle` reclaim policy is deprecated in favor of dynamic provisioning and it will be removed in future releases.
441+
The `recycle` reclaim policy is deprecated in favor of dynamic provisioning and is removed starting in {product-title} 3.6.
443442
====
444443

445444
[[pv-phase]]
@@ -475,7 +474,7 @@ ifdef::openshift-enterprise,openshift-origin[]
475474
=== Mount Options
476475
[IMPORTANT]
477476
====
478-
Mount Options is a Technology Preview feature and it is only available for manually provisioned persistent volumes.
477+
Mount Options is a Technology Preview feature and it is only available for manually provisioned PVs.
479478
ifdef::openshift-enterprise[]
480479
Technology Preview features are not supported with Red Hat production service
481480
level agreements (SLAs), might not be functionally complete, and Red Hat does
@@ -488,7 +487,7 @@ https://access.redhat.com/support/offerings/techpreview/.
488487
endif::[]
489488
====
490489

491-
You can specify mount options while mounting a persistent volume by using the annotation `volume.beta.kubernetes.io/mount-options`.
490+
You can specify mount options while mounting a PV by using the annotation `volume.beta.kubernetes.io/mount-options`.
492491

493492
For example:
494493

@@ -513,9 +512,9 @@ spec:
513512
name: claim1
514513
namespace: default
515514
----
516-
<1> Specified mount options are then used while mounting the persistent volume to the disk.
515+
<1> Specified mount options are then used while mounting the PV to the disk.
517516

518-
The following persistent volume types support mount options:
517+
The following PV types support mount options:
519518

520519
- NFS
521520
- GlusterFS
@@ -530,7 +529,7 @@ The following persistent volume types support mount options:
530529

531530
[NOTE]
532531
====
533-
Fibre Channel and HostPath persistent volumes do not support mount options.
532+
Fibre Channel and HostPath PVs do not support mount options.
534533
====
535534
endif::openshift-enterprise,openshift-origin[]
536535
[[persistent-volume-claims]]
@@ -619,7 +618,7 @@ ifdef::openshift-enterprise,openshift-origin[]
619618
== Block Volume Support
620619
[IMPORTANT]
621620
====
622-
Block Volume Support is a Technology Preview feature and it is only available for manually provisioned persistent volumes.
621+
Block Volume Support is a Technology Preview feature and it is only available for manually provisioned PVs.
623622
ifdef::openshift-enterprise[]
624623
Technology Preview features are not supported with Red Hat production service
625624
level agreements (SLAs), might not be functionally complete, and Red Hat does
@@ -670,7 +669,7 @@ spec:
670669
requests:
671670
storage: 10Gi
672671
----
673-
<1> `volumeMode` field indicating that a raw block persistent volume is requested.
672+
<1> `volumeMode` field indicating that a raw block PV is requested.
674673

675674
.Example Pod Specification
676675
[source, yaml]

install_config/configuring_pvc_protection.adoc

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[install-config-configuring-pvc-protection]]
2-
= Configuring for Persistent Volume Claim Protection
2+
= Configuring Persistent Volume Claim Protection
33
{product-version}
44
:data-uri:
55
:icons:
@@ -10,19 +10,23 @@
1010
toc::[]
1111

1212
== Overview
13-
{product-title} can be configured to have
14-
xref:../architecture/additional_concepts/storage.adoc#pvcprotection[Persistent Volume Claim Protection] feature enabled.
13+
{product-title} can be configured to have the
14+
xref:../architecture/additional_concepts/storage.adoc#pvcprotection[persistent
15+
volume claim (PVC) protection] feature enabled. This feature ensures that PVCs
16+
in active use by a pod are not removed from the system, as this may result in
17+
data loss.
1518

1619
[NOTE]
1720
====
18-
Persistent Volume Claim Protection is an alpha feature and may change in a future release of {product-title}.
21+
PVC protection is an alpha feature and may change in a future release of {product-title}.
1922
====
2023

2124
[[local-volume-enabling-local-volumes]]
22-
=== Enable Persistent Volume Claim Protection
23-
Enable the `PVCProtection` feature gate on all masters and nodes.
25+
=== Enable PVC Protection
2426

25-
. Edit or create the master configuration file on all masters (*_/etc/origin/master/master-config.yaml_* by default) and add `PVCProtection=true` under the `apiServerArguments` and `controllerArguments` sections and add `PVCProtection` admission plugin configuration under the `admissionConfig` section:
27+
To enable the `PVCProtection` feature gate on all masters and nodes:
28+
29+
. Edit or create the master configuration file on all masters (*_/etc/origin/master/master-config.yaml_* by default). Add `PVCProtection=true` under the `apiServerArguments` and `controllerArguments` sections, and add `PVCProtection` admission plugin configuration under the `admissionConfig` section:
2630
+
2731
[source, yaml]
2832
----
@@ -46,13 +50,13 @@ kubernetesMasterConfig:
4650
...
4751
----
4852

49-
. On all nodes, edit or create the node configuration file (*_/etc/origin/node/node-config.yaml_* by default) and add `PVCProtection=true` fetaure gate under `kubeletArguments`.
53+
. On all nodes, edit or create the node configuration file (*_/etc/origin/node/node-config.yaml_* by default), and add the `PVCProtection=true` feature gate under `kubeletArguments`:
5054
+
5155
[source, yaml]
5256
----
5357
kubeletArguments:
54-
feature-gates:
55-
- PVCProtection=true
58+
feature-gates:
59+
- PVCProtection=true
5660
----
5761

58-
. On all masters and nodes, restart OpenShift for the changes to take effect.
62+
. On all masters and nodes, restart {product-title} for the changes to take effect.

0 commit comments

Comments
 (0)