Bug 2046677 - Reclaimspacecronjob is not created after adding the annotation reclaimspace.csiaddons.openshift.io/schedule in PVC
Summary: Reclaimspacecronjob is not created after adding the annotation reclaimspace.c...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenShift Data Foundation
Classification: Red Hat Storage
Component: csi-addons
Version: 4.10
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ODF 4.10.0
Assignee: Rakshith
QA Contact: Jilju Joy
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-27 08:02 UTC by Jilju Joy
Modified: 2023-08-09 16:37 UTC (History)
6 users (show)

Fixed In Version: 4.10.0-132
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-13 18:52:21 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github csi-addons kubernetes-csi-addons pull 103 0 None Merged controller: add pvc finalizer rbac for annotation controller 2022-01-28 05:24:03 UTC
Github red-hat-storage kubernetes-csi-addons pull 23 0 None open Bug 2046677: controller: add pvc finalizer rbac for annotation controller 2022-01-31 05:28:24 UTC
Red Hat Product Errata RHSA-2022:1372 0 None None None 2022-04-13 18:52:29 UTC

Description Jilju Joy 2022-01-27 08:02:00 UTC
Description of problem (please be detailed as possible and provide log
snippests):
Reclaimspacecronjob is not created automatically after adding the annotation "reclaimspace.csiaddons.openshift.io/schedule=@midnight" in the PVC.

PVC before adding the annotation:

$ oc get pvc -n test-project -o yaml
apiVersion: v1
items:
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    annotations:
      pv.kubernetes.io/bind-completed: "yes"
      pv.kubernetes.io/bound-by-controller: "yes"
      volume.beta.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
      volume.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
    creationTimestamp: "2022-01-27T07:40:30Z"
    finalizers:
    - kubernetes.io/pvc-protection
    name: pvcrbd10
    namespace: test-project
    resourceVersion: "113029"
    uid: 57398f22-8f9d-49d9-83ac-3b05643e5df0
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 5Gi
    storageClassName: ocs-storagecluster-ceph-rbd
    volumeMode: Filesystem
    volumeName: pvc-57398f22-8f9d-49d9-83ac-3b05643e5df0
  status:
    accessModes:
    - ReadWriteOnce
    capacity:
      storage: 5Gi
    phase: Bound
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""


Adding annotation:
$ oc annotate pvc pvcrbd10 "reclaimspace.csiaddons.openshift.io/schedule=@midnight"
persistentvolumeclaim/pvcrbd10 annotated


PVC yaml after adding annotation:

$ oc get pvc -n test-project -o yaml
apiVersion: v1
items:
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    annotations:
      pv.kubernetes.io/bind-completed: "yes"
      pv.kubernetes.io/bound-by-controller: "yes"
      reclaimspace.csiaddons.openshift.io/cronjob: pvcrbd10-1643269448
      reclaimspace.csiaddons.openshift.io/schedule: '@midnight'
      volume.beta.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
      volume.kubernetes.io/storage-provisioner: openshift-storage.rbd.csi.ceph.com
    creationTimestamp: "2022-01-27T07:40:30Z"
    finalizers:
    - kubernetes.io/pvc-protection
    name: pvcrbd10
    namespace: test-project
    resourceVersion: "115263"
    uid: 57398f22-8f9d-49d9-83ac-3b05643e5df0
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 5Gi
    storageClassName: ocs-storagecluster-ceph-rbd
    volumeMode: Filesystem
    volumeName: pvc-57398f22-8f9d-49d9-83ac-3b05643e5df0
  status:
    accessModes:
    - ReadWriteOnce
    capacity:
      storage: 5Gi
    phase: Bound
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""


Reclaimspacecronjob not found after adding annotation.
$ oc get reclaimspacecronjobs.csiaddons.openshift.io -n test-project
No resources found in test-project namespace.

$ oc get reclaimspacecronjob pvcrbd10-1643269448 -n test-project
Error from server (NotFound): reclaimspacecronjobs.csiaddons.openshift.io "pvcrbd10-1643269448" not found

===============================================================
Version of all relevant components (if applicable):
ODF 4.10.0-122
OCP 4.10.0-0.nightly-2022-01-25-023600

Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?
The method to create ReclaimSpaceCronJob automatically is not working.

Is there any workaround available to the best of your knowledge?
No

Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?
1

Can this issue reproducible?
Yes

Can this issue reproduce from the UI?
Yes

If this is a regression, please provide more details to justify this:
New feature in 4.10

=========================================================
Steps to Reproduce:
1. Create a RBD PVC
2. Add annotation in the PVC to create ReclaimSpaceCronJob
example:
$ oc annotate pvc pvcrbd10 "reclaimspace.csiaddons.openshift.io/schedule=@midnight"
persistentvolumeclaim/pvcrbd10 annotated

3. Verify the presence of new reclaimspacecronjob.
examples:
$ oc get reclaimspacecronjobs.csiaddons.openshift.io -n test-project
$ oc get reclaimspacecronjob pvcrbd10-1643269448 -n test-project

Actual results:
Reclaimspacecronjob is not created

Expected results:
Reclaimspacecronjob should be created automatically after adding the annotation

Additional info:
logs will be added shortly

Comment 6 Jilju Joy 2022-02-01 14:50:54 UTC
Verified in version:
ODF 4.10.0-132
OCP 4.10.0-0.nightly-2022-01-31-012936


$ oc annotate pvc pvc-test-39359ba1335242e982ab1b7fab07fef "reclaimspace.csiaddons.openshift.io/schedule=@hourly" 
persistentvolumeclaim/pvc-test-39359ba1335242e982ab1b7fab07fef annotated

$ oc get reclaimspacecronjob  -n namespace-test-4b538b7c4334447bbb82dc171
NAME                                                  SCHEDULE   SUSPEND   ACTIVE   LASTSCHEDULE   AGE
pvc-test-39359ba1335242e982ab1b7fab07fef-1643726802   @hourly                                      58s


This is also tested by adding annotation from the console.

Comment 11 errata-xmlrpc 2022-04-13 18:52:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Red Hat OpenShift Data Foundation 4.10.0 enhancement, security & bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:1372


Note You need to log in before you can comment on or make changes to this bug.