Enabling reclaim space operation using ReclaimSpaceJob

ReclaimSpaceJob is a namespaced custom resource designed to invoke reclaim space operation on the target volume.

About this task

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.

Note:
  • 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

  1. 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: 360
    target
    Indicates the volume target on which the operation is going to perform.
    persistentVolumeClaim
    Contains a string indicating the name of PersistentVolumeClaim.
    backOfflimit
    Specifies the maximum number of retries before the reclaim space operation fails. If not specified, default value sets to 6. The maximum and minimum allowed value are 60 and 0.
    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

    600 seconds and the allowed maximum value is 1800seconds.
    timeout

    Specifies the timeout in seconds for the grpc request 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.

  2. Delete the customer resource after completion of the operation.