From a116764f4d3eb6f1dd1cdd9af22feb9fca1f8068 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 16 Apr 2020 12:01:33 +0530 Subject: [PATCH] Snapshot: Template changes for snapshot beta Updated the deployment templates and the sidecar images version to support snapshot beta version. Signed-off-by: Madhu Rajanna --- .../templates/provisioner-rules-clusterrole.yaml | 11 ++++------- charts/ceph-csi-rbd/values.yaml | 4 ++-- deploy/rbd/kubernetes/csi-provisioner-rbac.yaml | 14 +++++--------- .../rbd/kubernetes/csi-rbdplugin-provisioner.yaml | 4 ++-- examples/rbd/snapshot.yaml | 7 +++---- examples/rbd/snapshotclass.yaml | 5 +++-- 6 files changed, 19 insertions(+), 26 deletions(-) diff --git a/charts/ceph-csi-rbd/templates/provisioner-rules-clusterrole.yaml b/charts/ceph-csi-rbd/templates/provisioner-rules-clusterrole.yaml index 8e1f014e6..05074df5d 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-rules-clusterrole.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-rules-clusterrole.yaml @@ -29,25 +29,22 @@ rules: - apiGroups: [""] resources: ["endpoints"] verbs: ["get", "create", "update"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshots"] - verbs: ["get", "list", "watch", "update"] {{- if .Values.provisioner.attacher.enabled }} - apiGroups: ["storage.k8s.io"] resources: ["volumeattachments"] verbs: ["get", "list", "watch", "update", "patch"] {{- end }} + - apiGroups: ["snapshot.storage.k8s.io"] + resources: ["volumesnapshots"] + verbs: ["get", "list"] - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshotcontents"] verbs: ["create", "get", "list", "watch", "update", "delete"] - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshotclasses"] verbs: ["get", "list", "watch"] - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["create", "list", "watch", "delete", "get", "update"] - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshots/status"] + resources: ["volumesnapshotcontents/status"] verbs: ["update"] {{- if .Values.provisioner.resizer.enabled }} - apiGroups: [""] diff --git a/charts/ceph-csi-rbd/values.yaml b/charts/ceph-csi-rbd/values.yaml index 3830db511..6c5d2e8b6 100644 --- a/charts/ceph-csi-rbd/values.yaml +++ b/charts/ceph-csi-rbd/values.yaml @@ -142,7 +142,7 @@ provisioner: provisioner: image: repository: quay.io/k8scsi/csi-provisioner - tag: v1.4.0 + tag: v1.6.0 pullPolicy: IfNotPresent resources: {} @@ -167,7 +167,7 @@ provisioner: snapshotter: image: repository: quay.io/k8scsi/csi-snapshotter - tag: v1.2.2 + tag: v2.1.0 pullPolicy: IfNotPresent resources: {} diff --git a/deploy/rbd/kubernetes/csi-provisioner-rbac.yaml b/deploy/rbd/kubernetes/csi-provisioner-rbac.yaml index a0849681d..4cce4d751 100644 --- a/deploy/rbd/kubernetes/csi-provisioner-rbac.yaml +++ b/deploy/rbd/kubernetes/csi-provisioner-rbac.yaml @@ -37,21 +37,21 @@ rules: - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "update"] + - apiGroups: [""] + resources: ["persistentvolumeclaims/status"] + verbs: ["update", "patch"] - apiGroups: ["storage.k8s.io"] resources: ["storageclasses"] verbs: ["get", "list", "watch"] - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshots"] - verbs: ["get", "list", "watch", "update"] + verbs: ["get", "list"] - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshotcontents"] verbs: ["create", "get", "list", "watch", "update", "delete"] - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshotclasses"] verbs: ["get", "list", "watch"] - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["create", "list", "watch", "delete", "get", "update"] - apiGroups: ["storage.k8s.io"] resources: ["volumeattachments"] verbs: ["get", "list", "watch", "update", "patch"] @@ -59,12 +59,8 @@ rules: resources: ["csinodes"] verbs: ["get", "list", "watch"] - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshots/status"] + resources: ["volumesnapshotcontents/status"] verbs: ["update"] - - apiGroups: [""] - resources: ["persistentvolumeclaims/status"] - verbs: ["update", "patch"] - --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml b/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml index bcf5d56fc..f04890067 100644 --- a/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml +++ b/deploy/rbd/kubernetes/csi-rbdplugin-provisioner.yaml @@ -32,7 +32,7 @@ spec: serviceAccount: rbd-csi-provisioner containers: - name: csi-provisioner - image: quay.io/k8scsi/csi-provisioner:v1.4.0 + image: quay.io/k8scsi/csi-provisioner:v1.6.0 args: - "--csi-address=$(ADDRESS)" - "--v=5" @@ -49,7 +49,7 @@ spec: - name: socket-dir mountPath: /csi - name: csi-snapshotter - image: quay.io/k8scsi/csi-snapshotter:v1.2.2 + image: quay.io/k8scsi/csi-snapshotter:v2.1.0 args: - "--csi-address=$(ADDRESS)" - "--v=5" diff --git a/examples/rbd/snapshot.yaml b/examples/rbd/snapshot.yaml index f8ba15311..a7127ab57 100644 --- a/examples/rbd/snapshot.yaml +++ b/examples/rbd/snapshot.yaml @@ -1,10 +1,9 @@ --- -apiVersion: snapshot.storage.k8s.io/v1alpha1 +apiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshot metadata: name: rbd-pvc-snapshot spec: - snapshotClassName: csi-rbdplugin-snapclass + volumeSnapshotClassName: csi-rbdplugin-snapclass source: - name: rbd-pvc - kind: PersistentVolumeClaim + persistentVolumeClaimName: rbd-pvc diff --git a/examples/rbd/snapshotclass.yaml b/examples/rbd/snapshotclass.yaml index 1955cd4e1..6d6ad0b07 100644 --- a/examples/rbd/snapshotclass.yaml +++ b/examples/rbd/snapshotclass.yaml @@ -1,9 +1,9 @@ --- -apiVersion: snapshot.storage.k8s.io/v1alpha1 +apiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshotClass metadata: name: csi-rbdplugin-snapclass -snapshotter: rbd.csi.ceph.com +driver: rbd.csi.ceph.com parameters: # String representing a Ceph cluster to provision storage from. # Should be unique across all Ceph clusters in use for provisioning, @@ -16,3 +16,4 @@ parameters: csi.storage.k8s.io/snapshotter-secret-name: csi-rbd-secret csi.storage.k8s.io/snapshotter-secret-namespace: default +deletionPolicy: Delete