Skip to content

Commit 00b8dca

Browse files
Merge pull request #1636 from pospispa/86-5-add-checks-and-documentation-about-template-pods-for-recycling
Added a Recycler Pod Template Example
2 parents 35b62b0 + d4b9023 commit 00b8dca

File tree

1 file changed

+30
-1
lines changed
  • docs/user-guide/persistent-volumes

1 file changed

+30
-1
lines changed

docs/user-guide/persistent-volumes/index.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,36 @@ When a user is done with their volume, they can delete the PVC objects from the
7070

7171
### Reclaiming
7272

73-
The reclaim policy for a `PersistentVolume` tells the cluster what to do with the volume after it has been released of its claim. Currently, volumes can either be Retained, Recycled or Deleted. Retention allows for manual reclamation of the resource. For those volume plugins that support it, deletion removes both the `PersistentVolume` object from Kubernetes as well as deletes associated storage asset in external infrastructure such as AWS EBS, GCE PD or Cinder volume. Volumes that were dynamically provisioned are always deleted. If supported by appropriate volume plugin, recycling performs a basic scrub (`rm -rf /thevolume/*`) on the volume and makes it available again for a new claim.
73+
The reclaim policy for a `PersistentVolume` tells the cluster what to do with the volume after it has been released of its claim. Currently, volumes can either be Retained, Recycled or Deleted. Retention allows for manual reclamation of the resource. For those volume plugins that support it, deletion removes both the `PersistentVolume` object from Kubernetes as well as deletes associated storage asset in external infrastructure such as AWS EBS, GCE PD or Cinder volume. Volumes that were dynamically provisioned are always deleted.
74+
75+
#### Recycling
76+
77+
If supported by appropriate volume plugin, recycling performs a basic scrub (`rm -rf /thevolume/*`) on the volume and makes it available again for a new claim.
78+
79+
However, an administrator can configure a custom recycler pod templates using the Kubernetes controller manager command line arguments as described [here](/docs/admin/kube-controller-manager/). The custom recycler pod template must contain a `volumes` specification, as shown in the example below:
80+
81+
```yaml
82+
apiVersion: v1
83+
kind: Pod
84+
metadata:
85+
name: pv-recycler-
86+
namespace: default
87+
spec:
88+
restartPolicy: Never
89+
volumes:
90+
- name: vol
91+
hostPath:
92+
path: /any/path/it/will/be/replaced
93+
containers:
94+
- name: pv-recycler
95+
image: "gcr.io/google_containers/busybox"
96+
command: ["/bin/sh", "-c", "test -e /scrub && rm -rf /scrub/..?* /scrub/.[!.]* /scrub/* && test -z \"$(ls -A /scrub)\" || exit 1"]
97+
volumeMounts:
98+
- name: vol
99+
mountPath: /scrub
100+
```
101+
102+
However, the particular path specified in the custom recycler pod template in the `volumes` part is replaced with the particular path of the volume that is being recycled.
74103

75104
## Types of Persistent Volumes
76105

0 commit comments

Comments
 (0)