10.2. Enabling reclaim space operation using ReclaimSpaceJob
ReclaimSpaceJob is a namespaced custom resource (CR) designed to invoke reclaim space operation on the target volume. This is a one time method that immediately starts the reclaim space operation. You have to repeat the creation of ReclaimSpaceJob CR to repeat the reclaim space operation when required.
注意
-
Recommended interval between the reclaim space operations is
weekly. -
Ensure that the minimum interval between each operation is at least
24 hours. - Schedule the reclaim space operation during off-peak, maintenance window, or when the workload input/output is expected to be low.
Procedure
Create and apply the following custom resource for reclaim space operation:
apiVersion: csiaddons.openshift.io/v1alpha1 kind: ReclaimSpaceJob metadata: name: sample-1 spec: target: persistentVolumeClaim: pvc-1 timeout: 360where,
target- Indicates the volume target on which the operation is performed.
persistentVolumeClaim-
Name of the
PersistentVolumeClaim. backOfflimit-
Specifies the maximum number of retries before marking the reclaim space operation as
failed. The default value is6. The allowed maximum and minimum values are60and0respectively. retryDeadlineSeconds-
Specifies the duration in which the operation might retire in seconds and it is relative to the start time. The value must be a positive integer. The default value is
600seconds and the allowed maximum value is1800seconds. timeout-
Specifies the timeout in seconds for the
grpcrequest sent to the CSI driver. If the timeout value is not specified, it defaults to the value of global reclaimspace timeout. Minimum allowed value for timeout is 60.
- Delete the custom resource after completion of the operation.