Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controllers: generate VGSClass #296

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

rewantsoni
Copy link
Member

@rewantsoni rewantsoni commented Jan 29, 2025

Changes

RHSTOR-5795

Depends on: red-hat-storage/ocs-operator#2989

@rewantsoni
Copy link
Member Author

/hold for testing

Fixes issues with PR: #168

1. Set the snapshotpolicy
2. Deploy the VGSC if crd is present

Signed-off-by: raaizik <[email protected]>
Signed-off-by: Rewant Soni <[email protected]>
@rewantsoni
Copy link
Member Author

Testing for cephfs:

[rewantsoni pratik-qe] k get volumegroupsnapshotclass ocs-storagecluster-cephfs-groupsnapclass -oyaml 
apiVersion: groupsnapshot.storage.k8s.io/v1beta1
deletionPolicy: Delete
driver: openshift-storage.cephfs.csi.ceph.com
kind: VolumeGroupSnapshotClass
metadata:
  annotations:
    ocs.openshift.io/storageclaim: ocs-storagecluster-cephfs
  creationTimestamp: "2025-01-30T06:05:23Z"
  generation: 1
  labels:
    ramendr.openshift.io/storageid: 6e53f1b1b58177e833bb28af02f964ad
  name: ocs-storagecluster-cephfs-groupsnapclass
  ownerReferences:
  - apiVersion: ocs.openshift.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: StorageClaim
    name: ocs-storagecluster-cephfs
    uid: 7f886ee2-5a2c-40aa-b0fd-821ed156eb1d
  resourceVersion: "6030685"
  uid: 3f41d8ff-d4a2-41a6-970a-b2bfa00a833f
parameters:
  clusterID: fe09c94a50c72d033da43478c21b8314
  csi.storage.k8s.io/group-snapshotter-secret-name: ceph-client-provisioner-6e53f1b1b58177e833bb28af02f964ad
  csi.storage.k8s.io/group-snapshotter-secret-namespace: openshift-storage
  fsName: ocs-storagecluster-cephfilesystem
[rewantsoni pratik-qe] oc get volumegroupsnapshot,volumegroupsnapshotcontent 
NAME                                                                    READYTOUSE   VOLUMEGROUPSNAPSHOTCLASS                   VOLUMEGROUPSNAPSHOTCONTENT                              CREATIONTIME   AGE
volumegroupsnapshot.groupsnapshot.storage.k8s.io/cephfs-groupsnapshot   true         ocs-storagecluster-cephfs-groupsnapclass   groupsnapcontent-67b7b24a-efe1-4d17-aebe-deb10f1389d8   3m33s          24m

NAME                                                                                                            READYTOUSE   DELETIONPOLICY   DRIVER                                  VOLUMEGROUPSNAPSHOTCLASS                   VOLUMEGROUPSNAPSHOTNAMESPACE   VOLUMEGROUPSNAPSHOT    AGE
volumegroupsnapshotcontent.groupsnapshot.storage.k8s.io/groupsnapcontent-67b7b24a-efe1-4d17-aebe-deb10f1389d8   true         Delete           openshift-storage.cephfs.csi.ceph.com   ocs-storagecluster-cephfs-groupsnapclass   openshift-storage              cephfs-groupsnapshot   24m

[rewantsoni pratik-qe] cat pvc-restore 
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: cephfs-pvc-restore
spec:
  storageClassName: ocs-storagecluster-cephfs
  dataSource:
    name: cephfs-groupsnapshot
    kind: VolumeGroupSnapshot
    apiGroup: groupsnapshot.storage.k8s.io
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Gi
[rewantsoni pratik-qe] k apply -f pvc-restore 
persistentvolumeclaim/cephfs-pvc-restore created
[rewantsoni pratik-qe] k get pvc
NAME                                    STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                  VOLUMEATTRIBUTESCLASS   AGE
cephfs-pvc                              Bound    pvc-c00f6a60-d341-4008-9ad7-2130a03b4c09   1Gi        RWO            ocs-storagecluster-cephfs     <unset>                 15h
cephfs-pvc-restore                      Bound    pvc-f0d62cc4-a457-480d-bf56-ccee5aace8e3   1Gi        RWX            ocs-storagecluster-cephfs     <unset>                 5s

@rewantsoni
Copy link
Member Author

Testing for rbd:

[rewantsoni pratik-qe] k get volumegroupsnapshotclass ocs-storagecluster-ceph-rbd-groupsnapclass -oyaml
apiVersion: groupsnapshot.storage.k8s.io/v1beta1
deletionPolicy: Delete
driver: openshift-storage.rbd.csi.ceph.com
kind: VolumeGroupSnapshotClass
metadata:
  annotations:
    ocs.openshift.io/storageclaim: ocs-storagecluster-ceph-rbd
  creationTimestamp: "2025-01-30T06:05:09Z"
  generation: 1
  labels:
    ramendr.openshift.io/storageid: 82ed8e84c34e972a28a7a7ed79a7eac5
  name: ocs-storagecluster-ceph-rbd-groupsnapclass
  ownerReferences:
  - apiVersion: ocs.openshift.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: StorageClaim
    name: ocs-storagecluster-ceph-rbd
    uid: 13222d24-2321-4846-8145-6e28cbbd1d25
  resourceVersion: "6030250"
  uid: 3d16e87a-5afc-4adf-92f6-6c35061a0c4e
parameters:
  clusterID: 81fd58def37a35d1b4d4bee7ba35c3c3
  csi.storage.k8s.io/group-snapshotter-secret-name: ceph-client-provisioner-82ed8e84c34e972a28a7a7ed79a7eac5
  csi.storage.k8s.io/group-snapshotter-secret-namespace: openshift-storage
  pool: ocs-storagecluster-cephblockpool

[rewantsoni pratik-qe] oc get volumegroupsnapshot,volumegroupsnapshotcontent                           
NAME                                                                     READYTOUSE   VOLUMEGROUPSNAPSHOTCLASS                     VOLUMEGROUPSNAPSHOTCONTENT                              CREATIONTIME   AGE
volumegroupsnapshot.groupsnapshot.storage.k8s.io/cephrbd-groupsnapshot   true         ocs-storagecluster-ceph-rbd-groupsnapclass   groupsnapcontent-72b9063e-80f0-4221-a18e-29d54d8289ff   23s            24s

NAME                                                                                                            READYTOUSE   DELETIONPOLICY   DRIVER                                  VOLUMEGROUPSNAPSHOTCLASS                     VOLUMEGROUPSNAPSHOTNAMESPACE   VOLUMEGROUPSNAPSHOT     AGE
volumegroupsnapshotcontent.groupsnapshot.storage.k8s.io/groupsnapcontent-72b9063e-80f0-4221-a18e-29d54d8289ff   true         Delete           openshift-storage.rbd.csi.ceph.com      ocs-storagecluster-ceph-rbd-groupsnapclass   openshift-storage              cephrbd-groupsnapshot   25s

[rewantsoni pratik-qe] cat pvc-rbd-restore 
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: cephrbd-pvc-restore
spec:
  storageClassName: ocs-storagecluster-ceph-rbd
  dataSource:
    name: cephrbd-groupsnapshot
    kind: VolumeGroupSnapshot
    apiGroup: groupsnapshot.storage.k8s.io
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

[rewantsoni pratik-qe] k get pvc                 
NAME                                    STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                  VOLUMEATTRIBUTESCLASS   AGE
cephrbd-pvc                             Bound    pvc-1612e508-570a-4082-bc0a-935a7066b928   1Gi        RWO            ocs-storagecluster-ceph-rbd   <unset>                 57s
cephrbd-pvc-restore                     Bound    pvc-7099c268-3607-4036-ba36-7637637b83dc   1Gi        RWO            ocs-storagecluster-ceph-rbd   <unset>                 6s

@rewantsoni
Copy link
Member Author

/unhold

Copy link
Contributor

@leelavg leelavg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I see @Madhu-1 review on older PR and need the review for merge?

@rewantsoni
Copy link
Member Author

LGTM, I see @Madhu-1 review on older PR and need the review for merge?

@Madhu-1 mentioned that we can merge it if it is tested

@rewantsoni
Copy link
Member Author

/cherry-pick release-4.18

@openshift-cherrypick-robot

@rewantsoni: once the present PR merges, I will cherry-pick it on top of release-4.18 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

openshift-ci bot commented Jan 30, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Madhu-1, rewantsoni

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 820dc23 into red-hat-storage:main Jan 30, 2025
12 checks passed
@openshift-cherrypick-robot

@rewantsoni: new pull request created: #297

In response to this:

/cherry-pick release-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants