From f1575f40c22841adad4c1482d5c48ebc36212707 Mon Sep 17 00:00:00 2001 From: Qiming Teng Date: Mon, 14 Mar 2022 20:20:04 +0800 Subject: [PATCH 1/2] Fix link in change PV reclaim policy page --- .../administer-cluster/change-pv-reclaim-policy.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/content/en/docs/tasks/administer-cluster/change-pv-reclaim-policy.md b/content/en/docs/tasks/administer-cluster/change-pv-reclaim-policy.md index 408438e1de..48ec32d80c 100644 --- a/content/en/docs/tasks/administer-cluster/change-pv-reclaim-policy.md +++ b/content/en/docs/tasks/administer-cluster/change-pv-reclaim-policy.md @@ -7,14 +7,10 @@ content_type: task This page shows how to change the reclaim policy of a Kubernetes PersistentVolume. - ## {{% heading "prerequisites" %}} - {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} - - ## Why change reclaim policy of a PersistentVolume @@ -81,8 +77,6 @@ kubectl patch pv -p "{\"spec\":{\"persistentVolumeReclaimPolicy\" `default/claim3` has reclaim policy `Retain`. It will not be automatically deleted when a user deletes claim `default/claim3`. - - ## {{% heading "whatsnext" %}} * Learn more about [PersistentVolumes](/docs/concepts/storage/persistent-volumes/). @@ -91,8 +85,6 @@ kubectl patch pv -p "{\"spec\":{\"persistentVolumeReclaimPolicy\" ### References {#reference} * {{< api-reference page="config-and-storage-resources/persistent-volume-v1" >}} - * Pay attention to the `.spec.persistentVolumeReclaimPolicy` [field](https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-v1/#PersistentVolumeSpec) of PersistentVolume. + * Pay attention to the `.spec.persistentVolumeReclaimPolicy` [field](/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-v1/#PersistentVolumeSpec) of PersistentVolume. * {{< api-reference page="config-and-storage-resources/persistent-volume-claim-v1" >}} - - From e9a8cc6edaba82a73aeadec13064cc0a58aec2e3 Mon Sep 17 00:00:00 2001 From: Qiming Teng Date: Mon, 14 Mar 2022 20:22:22 +0800 Subject: [PATCH 2/2] Reformat the indentation of lists and sample outputs --- .../change-pv-reclaim-policy.md | 71 ++++++++++--------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/content/en/docs/tasks/administer-cluster/change-pv-reclaim-policy.md b/content/en/docs/tasks/administer-cluster/change-pv-reclaim-policy.md index 48ec32d80c..457fbd6332 100644 --- a/content/en/docs/tasks/administer-cluster/change-pv-reclaim-policy.md +++ b/content/en/docs/tasks/administer-cluster/change-pv-reclaim-policy.md @@ -29,53 +29,58 @@ Released phase, where all of its data can be manually recovered. 1. List the PersistentVolumes in your cluster: - ```shell - kubectl get pv - ``` + ```shell + kubectl get pv + ``` - The output is similar to this: + The output is similar to this: - NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE - pvc-b6efd8da-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim1 manual 10s - pvc-b95650f8-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim2 manual 6s - pvc-bb3ca71d-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim3 manual 3s + ```none + NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE + pvc-b6efd8da-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim1 manual 10s + pvc-b95650f8-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim2 manual 6s + pvc-bb3ca71d-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim3 manual 3s + ``` - This list also includes the name of the claims that are bound to each volume + This list also includes the name of the claims that are bound to each volume for easier identification of dynamically provisioned volumes. 1. Choose one of your PersistentVolumes and change its reclaim policy: - ```shell - kubectl patch pv -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}' - ``` + ```shell + kubectl patch pv -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}' + ``` - where `` is the name of your chosen PersistentVolume. + where `` is the name of your chosen PersistentVolume. - {{< note >}} - On Windows, you must _double_ quote any JSONPath template that contains spaces (not single quote as shown above for bash). This in turn means that you must use a single quote or escaped double quote around any literals in the template. For example: + {{< note >}} + On Windows, you must _double_ quote any JSONPath template that contains spaces (not single + quote as shown above for bash). This in turn means that you must use a single quote or escaped + double quote around any literals in the template. For example: -```cmd -kubectl patch pv -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":\"Retain\"}}" -``` - - {{< /note >}} + ```cmd + kubectl patch pv -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":\"Retain\"}}" + ``` + {{< /note >}} 1. Verify that your chosen PersistentVolume has the right policy: - ```shell - kubectl get pv - ``` + ```shell + kubectl get pv + ``` - The output is similar to this: + The output is similar to this: - NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE - pvc-b6efd8da-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim1 manual 40s - pvc-b95650f8-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim2 manual 36s - pvc-bb3ca71d-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Retain Bound default/claim3 manual 33s + ```none + NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE + pvc-b6efd8da-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim1 manual 40s + pvc-b95650f8-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Delete Bound default/claim2 manual 36s + pvc-bb3ca71d-b7b5-11e6-9d58-0ed433a7dd94 4Gi RWO Retain Bound default/claim3 manual 33s + ``` - In the preceding output, you can see that the volume bound to claim - `default/claim3` has reclaim policy `Retain`. It will not be automatically - deleted when a user deletes claim `default/claim3`. + In the preceding output, you can see that the volume bound to claim + `default/claim3` has reclaim policy `Retain`. It will not be automatically + deleted when a user deletes claim `default/claim3`. ## {{% heading "whatsnext" %}} @@ -85,6 +90,8 @@ kubectl patch pv -p "{\"spec\":{\"persistentVolumeReclaimPolicy\" ### References {#reference} * {{< api-reference page="config-and-storage-resources/persistent-volume-v1" >}} - * Pay attention to the `.spec.persistentVolumeReclaimPolicy` [field](/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-v1/#PersistentVolumeSpec) of PersistentVolume. + * Pay attention to the `.spec.persistentVolumeReclaimPolicy` + [field](/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-v1/#PersistentVolumeSpec) + of PersistentVolume. * {{< api-reference page="config-and-storage-resources/persistent-volume-claim-v1" >}}