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
Copy file name to clipboardExpand all lines: docs/concepts/storage/persistent-volumes.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ However, the particular path specified in the custom recycler pod template in th
107
107
108
108
#### Deleting
109
109
110
-
For volume plugins that support the Delete reclaim policy, deletion removes both the `PersistentVolume` object from Kubernetes, as well as deleting the associated storage asset in the external infrastructure, such as an AWS EBS, GCE PD, Azure Disk, or Cinder volume. Volumes that were dynamically provisioned are always deleted. If that is not desired, currently, the only option is to edit or patch the PV after it is created. See [Change the Reclaim Policy of a PersistentVolume](https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/).
110
+
For volume plugins that support the Delete reclaim policy, deletion removes both the `PersistentVolume` object from Kubernetes, as well as deleting the associated storage asset in the external infrastructure, such as an AWS EBS, GCE PD, Azure Disk, or Cinder volume. Volumes that were dynamically provisioned inherit the [reclaim policy of their `StorageClass`](#reclaim-policy-1), which defaults to Delete. The administrator should configure the `StorageClass` according to users' expectations, otherwise the PV must be edited or patched after it is created. See [Change the Reclaim Policy of a PersistentVolume](https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/).
111
111
112
112
## Types of Persistent Volumes
113
113
@@ -378,9 +378,9 @@ spec:
378
378
379
379
## StorageClasses
380
380
381
-
Each `StorageClass` contains the fields `provisioner` and `parameters`, which
382
-
are used when a `PersistentVolume` belonging to the class needs to be
383
-
dynamically provisioned.
381
+
Each `StorageClass` contains the fields `provisioner`, `parameters`, and
382
+
`reclaimPolicy`, which are used when a `PersistentVolume` belonging to the
383
+
class needs to be dynamically provisioned.
384
384
385
385
The name of a `StorageClass` object is significant, and is how users can
386
386
request a particular class. Administrators set the name and other parameters
@@ -400,6 +400,7 @@ metadata:
400
400
provisioner: kubernetes.io/aws-ebs
401
401
parameters:
402
402
type: gp2
403
+
reclaimPolicy: Retain
403
404
mountOptions:
404
405
- debug
405
406
```
@@ -445,9 +446,10 @@ There are also cases when 3rd party storage vendors provide their own external
445
446
provisioner.
446
447
447
448
### Reclaim Policy
448
-
Persistent Volumes that are dynamically created by a storage class will have a reclaim
449
-
policy of `delete`. If that is not desired, the only current option is to edit the
450
-
PV after it is created.
449
+
Persistent Volumes that are dynamically created by a storage class will have the
450
+
reclaim policy specified in the `reclaimPolicy` field of the class, which can be
451
+
either `Delete` or `Retain`. If no `reclaimPolicy` is specified when a
452
+
`StorageClass`object is created, it will default to `Delete`.
451
453
452
454
Persistent Volumes that are created manually and managed via a storage class will have
453
455
whatever reclaim policy they were assigned at creation.
0 commit comments