Skip to content

Commit

Permalink
Bring PVC Protection Feature to Beta (#7165)
Browse files Browse the repository at this point in the history
* Bring PVC Protection Feature to Beta

The PR: kubernetes/kubernetes#59052
brought PVC Protection feature to beta.

That's why the documentation is updated accordingly.

* The PVC Protection feature was renamed to Storage Protection. That's why the documentation is updated.
  • Loading branch information
pospispa authored and zacharysarah committed Apr 16, 2018
1 parent b7bced3 commit 64efca4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
10 changes: 10 additions & 0 deletions docs/admin/admission-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ This admission controller also protects the access to `metadata.ownerReferences[
of an object, so that only users with "update" permission to the `finalizers`
subresource of the referenced *owner* can change it.

<<<<<<< HEAD
<<<<<<< HEAD
### PersistentVolumeLabel (DEPRECATED)
||||||| merged common ancestors
Expand All @@ -428,6 +429,15 @@ The `PVCProtection` plugin adds the `kubernetes.io/pvc-protection` finalizer to
### Persistent Volume Claim Protection (alpha)
{% assign for_k8s_version="v1.9" %}{% include feature-state-alpha.md %}
The `PVCProtection` plugin adds the `kubernetes.io/pvc-protection` finalizer to newly created Persistent Volume Claims (PVCs). In case a user deletes a PVC the PVC is not removed until the finalizer is removed from the PVC by PVC Protection Controller. Refer to the [PVC Protection](/docs/concepts/storage/persistent-volumes/#persistent-volume-claim-protection) for more detailed information.
||||||| merged common ancestors
### Persistent Volume Claim Protection (alpha)
{% assign for_k8s_version="v1.9" %}{% include feature-state-alpha.md %}
The `PVCProtection` plugin adds the `kubernetes.io/pvc-protection` finalizer to newly created Persistent Volume Claims (PVCs). In case a user deletes a PVC the PVC is not removed until the finalizer is removed from the PVC by PVC Protection Controller. Refer to the [PVC Protection](/docs/concepts/storage/persistent-volumes/#persistent-volume-claim-protection) for more detailed information.
=======
### Storage Protection (beta)
{% assign for_k8s_version="v1.10" %}{% include feature-state-beta.md %}
The `StorageProtection` plugin adds the `kubernetes.io/pvc-protection` or `kubernetes.io/pv-protection` finalizers to newly created Persistent Volume Claims (PVCs) or Persistent Volumes (PV). In case a user deletes a PVC or PV the PVC or PV is not removed until the finalizer is removed from the PVC or PV by PVC or PV Protection Controller. Refer to the [PVC Protection](/docs/concepts/storage/persistent-volumes/#persistent-volume-claim-protection) for more detailed information.
>>>>>>> Bring PVC Protection Feature to Beta (#7165)

### PersistentVolumeLabel (DEPRECATED)
>>>>>>> deprecate three admission controller (#7363)
Expand Down
16 changes: 16 additions & 0 deletions docs/concepts/storage/persistent-volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,30 @@ Pods use claims as volumes. The cluster inspects the claim to find the bound vol

Once a user has a claim and that claim is bound, the bound PV belongs to the user for as long as they need it. Users schedule Pods and access their claimed PVs by including a `persistentVolumeClaim` in their Pod's volumes block. [See below for syntax details](#claims-as-volumes).

<<<<<<< HEAD
### Storage Object in Use Protection
{% assign for_k8s_version="v1.10" %}{% include feature-state-beta.md %}
The purpose of the Storage Object in Use Protection feature is to ensure that Persistent Volume Claims (PVCs) in active use by a pod and Persistent Volume (PVs) that are bound to PVCs are not removed from the system as this may result in data loss.
||||||| merged common ancestors
### Persistent Volume Claim Protection
{% assign for_k8s_version="v1.9" %}{% include feature-state-alpha.md %}
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.
=======
### Storage Protection
{% assign for_k8s_version="v1.10" %}{% include feature-state-beta.md %}
The purpose of the Storage Protection feature is to ensure that Persistent Volume Claims (PVCs) in active use by a pod are not removed from the system as this may result in data loss.
>>>>>>> Bring PVC Protection Feature to Beta (#7165)
**Note:** PVC is in active use by a pod when the pod status is `Pending` and the pod is assigned to a node or the pod status is `Running`.
{: .note}

<<<<<<< HEAD
When the [Storage Object in Use Protection beta feature](/docs/tasks/administer-cluster/storage-object-in-use-protection/) 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, and also if admin deletes a PV that is bound to a PVC, the PV is not removed immediately. PV removal is postponed until the PV is not bound to a PVC any more.
||||||| merged common ancestors
When the [PVC protection alpha feature](/docs/tasks/administer-cluster/pvc-protection/) 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.
=======
When the [Storage Protection beta feature](/docs/tasks/administer-cluster/pvc-protection/) 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.
>>>>>>> Bring PVC Protection Feature to Beta (#7165)
You can see that a PVC is protected when the PVC's status is `Terminating` and the `Finalizers` list includes `kubernetes.io/pvc-protection`:

Expand Down
15 changes: 6 additions & 9 deletions docs/tasks/administer-cluster/pvc-protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
reviewers:
- msau42
- jsafrane
title: Persistent Volume Claim Protection
title: Storage Protection
---

{% capture overview %}
{% assign for_k8s_version="v1.9" %}{% include feature-state-alpha.md %}
{% assign for_k8s_version="v1.10" %}{% include feature-state-beta.md %}

As of Kubernetes 1.9, persistent volume claims (PVCs) that are in active use by a pod can be protected from pre-mature removal.
Persistent volume claims (PVCs) that are in active use by a pod can be protected from pre-mature removal.

{% endcapture %}

{% capture prerequisites %}

- A v1.9 or higher Kubernetes must be installed.
- As PVC Protection is a Kubernetes v1.9 alpha feature it must be enabled:
1. [Admission controller](/docs/admin/admission-controllers/) must be started with the [PVC Protection plugin](/docs/admin/admission-controllers/#persistent-volume-claim-protection-alpha).
2. All Kubernetes components must be started with the `PVCProtection` alpha features enabled.
- The Storage Protection feature is enabled in a version of Kubernetes in which it is supported.

{% endcapture %}

{% capture steps %}

## PVC Protection Verification
## Storage Protection feature used for PVC Protection

The example below uses a GCE PD `StorageClass`, however, similar steps can be performed for any volume type.

Expand Down Expand Up @@ -216,7 +213,7 @@ spec:
Warning FailedScheduling 18s (x4 over 21s) default-scheduler persistentvolumeclaim "slzc" is being deleted
```

- Wait until the pod status of both pods is `Terminated` (either delete the pods or wait until they finish). Afterwards, check that the PVC is removed.
- Wait until the pod status of both pods is `Terminated` or `Completed` (either delete the pods or wait until they finish). Afterwards, check that the PVC is removed.

{% endcapture %}

Expand Down

0 comments on commit 64efca4

Please sign in to comment.