10.3. Enabling reclaim space operation using ReclaimSpaceCronJob


ReclaimSpaceCronJob invokes the reclaim space operation based on the given schedule such as daily, weekly, and so on. You have to create ReclaimSpaceCronJob only once for a persistent volume claim. The CSI-addons controller creates a ReclaimSpaceJob at the requested time and interval with the schedule attribute.

참고
  • Recommended schedule interval is @weekly.
  • Minimum interval between each scheduled operation should be at least 24 hours. For example, @daily (At 00:00 every day) or “0 3 * * *” (At 3:00 every day).
  • Schedule the ReclaimSpace operation during off-peak, maintenance window, or the interval when 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: ReclaimSpaceCronJob
    metadata:
      name: reclaimspacecronjob-sample
    spec:
      jobTemplate:
        spec:
          target:
            persistentVolumeClaim: data-pvc
          timeout: 360
      schedule: '@weekly'
      concurrencyPolicy: Forbid

    where,

    concurrencyPolicy
    Describes the changes when a new ReclaimSpaceJob is scheduled by the ReclaimSpaceCronJob, while a previous ReclaimSpaceJob is still running. The default Forbid prevents starting a new job whereas Replace can be used to delete the running job potentially in a failure state and create a new one.
    failedJobsHistoryLimit
    Specifies the number of failed ReclaimSpaceJobs that are kept for troubleshooting.
    jobTemplate
    Specifies the ReclaimSpaceJob.spec structure that describes the details of the requested ReclaimSpaceJob operation.
    successfulJobsHistoryLimit
    Specifies the number of successful ReclaimSpaceJob operations.
    schedule
    Specifieds the and/or interval of the recurring operation request and it is in the same format as the Kubernetes CronJobs.
  2. Delete the ReclaimSpaceCronJob custom resource when execution of reclaim space operation is no longer needed or when the target PVC is deleted.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동