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.

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
    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 relative to the start time. Its value must be a positive integer and unit of time is in seconds. If not specified, the default is set to 600 seconds. The maximum allowed value is 1800.
  2. Delete the customer resource after completion of the operation.