From 5e0dd886768dd4e3e7a7d55b8057a4cbd38d3afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Va=C5=A1ek?= Date: Thu, 1 Oct 2020 12:56:54 +0200 Subject: [PATCH] [manila-csi-plugin] Updated external-snapshotter to v2.1.1 and external-provisioner to v2.0.2 (#1205) * updated k8s manifests * updated Helm chart * updated examples * updated docs * fixed RBAC rules external-provisioner needs VolumeSnapshots from snapshot.storage.k8s.io with GET,LIST verbs for provisioning volumes from snapshots * bumped chart's major version due to backwards incompatibility * apiGroup is not versioned * updated external-provisioner to v2.0.2 This is necessary in order to support v1beta1 snapshots as a data source. --- charts/manila-csi-plugin/Chart.yaml | 2 +- .../templates/controllerplugin-rules-clusterrole.yaml | 11 ++++------- charts/manila-csi-plugin/values.yaml | 4 ++-- docs/using-manila-csi-plugin.md | 8 ++++---- .../manila-csi-plugin/nfs/snapshot/snapshotclass.yaml | 5 +++-- .../nfs/snapshot/snapshotcreate.yaml | 7 +++---- .../manila-csi-plugin/csi-controllerplugin-rbac.yaml | 11 ++++------- manifests/manila-csi-plugin/csi-controllerplugin.yaml | 4 ++-- 8 files changed, 23 insertions(+), 29 deletions(-) diff --git a/charts/manila-csi-plugin/Chart.yaml b/charts/manila-csi-plugin/Chart.yaml index 486ab809e8..4097acc90f 100644 --- a/charts/manila-csi-plugin/Chart.yaml +++ b/charts/manila-csi-plugin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: latest description: Manila CSI Chart for OpenStack name: openstack-manila-csi -version: 0.2.1 +version: 1.0.0 home: http://github.com/kubernetes/cloud-provider-openstack icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png maintainers: diff --git a/charts/manila-csi-plugin/templates/controllerplugin-rules-clusterrole.yaml b/charts/manila-csi-plugin/templates/controllerplugin-rules-clusterrole.yaml index e17e6e9366..1571fa1a92 100644 --- a/charts/manila-csi-plugin/templates/controllerplugin-rules-clusterrole.yaml +++ b/charts/manila-csi-plugin/templates/controllerplugin-rules-clusterrole.yaml @@ -34,15 +34,12 @@ rules: - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshotclasses"] verbs: ["get", "list", "watch"] + - 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: ["volumesnapshots"] - verbs: ["get", "list", "watch", "update"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshots/status"] + resources: ["volumesnapshotcontents/status"] verbs: ["update"] - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["create", "list", "watch", "delete", "get", "update"] diff --git a/charts/manila-csi-plugin/values.yaml b/charts/manila-csi-plugin/values.yaml index b7e9f7a148..f4a3a177a3 100644 --- a/charts/manila-csi-plugin/values.yaml +++ b/charts/manila-csi-plugin/values.yaml @@ -67,14 +67,14 @@ controllerplugin: provisioner: image: repository: quay.io/k8scsi/csi-provisioner - tag: v1.4.0 + tag: v2.0.2 pullPolicy: IfNotPresent resources: {} # CSI external-snapshotter container spec snapshotter: image: repository: quay.io/k8scsi/csi-snapshotter - tag: v1.2.2 + tag: v2.1.1 pullPolicy: IfNotPresent resources: {} nodeSelector: {} diff --git a/docs/using-manila-csi-plugin.md b/docs/using-manila-csi-plugin.md index 21662270f1..767132226c 100644 --- a/docs/using-manila-csi-plugin.md +++ b/docs/using-manila-csi-plugin.md @@ -12,7 +12,7 @@ - [Topology-aware dynamic provisioning](#topology-aware-dynamic-provisioning) - [Runtime configuration file](#runtime-configuration-file) - [Deployment](#deployment) - - [Kubernetes 1.15+](#kubernetes-115) + - [Kubernetes 1.17+](#kubernetes-117) - [Verifying the deployment](#verifying-the-deployment) - [Enabling topology awareness](#enabling-topology-awareness) - [Share protocol support matrix](#share-protocol-support-matrix) @@ -147,12 +147,12 @@ The CSI Manila driver deals with the Manila service only. All node-related opera A single instance of the driver may serve only a single Manila share protocol. To serve multiple share protocols, multiple deployments of the driver need to be made. In order to avoid deployment collisions, each instance of the driver should be named differently, e.g. `csi-manila-cephfs`, `csi-manila-nfs`. -### Kubernetes 1.15+ - -Snapshots require `VolumeSnapshotDataSource=true` feature gate. +### Kubernetes 1.17+ The deployment consists of two main components: Controller and Node plugins along with their respective RBACs. Controller plugin is deployed as a StatefulSet and runs CSI Manila, [external-provisioner](https://github.com/kubernetes-csi/external-provisioner) and [external-snapshotter](https://github.com/kubernetes-csi/external-snapshotter). Node plugin is deployed as a DaemonSet and runs CSI Manila and [csi-node-driver-registrar](https://github.com/kubernetes-csi/node-driver-registrar). +Note: Snapshotting feature now requires a separate snapshot controller and CRDs to be deployed in the cluster. Please follow the related official [installation instructions](https://github.com/kubernetes-csi/external-snapshotter/blob/master/README.md#usage) for [external-snapshotter](https://github.com/kubernetes-csi/external-snapshotter) before continuing. + **Deploying with Helm** This is the preferred way of deployment because it greatly simplifies the difficulties with managing multiple share protocols. diff --git a/examples/manila-csi-plugin/nfs/snapshot/snapshotclass.yaml b/examples/manila-csi-plugin/nfs/snapshot/snapshotclass.yaml index fb5b37fc9c..3b12136b7e 100644 --- a/examples/manila-csi-plugin/nfs/snapshot/snapshotclass.yaml +++ b/examples/manila-csi-plugin/nfs/snapshot/snapshotclass.yaml @@ -1,8 +1,9 @@ -apiVersion: snapshot.storage.k8s.io/v1alpha1 +apiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshotClass metadata: name: csi-manila-nfs -snapshotter: nfs.manila.csi.openstack.org +driver: nfs.manila.csi.openstack.org +deletionPolicy: Delete parameters: csi.storage.k8s.io/snapshotter-secret-name: csi-manila-secrets csi.storage.k8s.io/snapshotter-secret-namespace: default diff --git a/examples/manila-csi-plugin/nfs/snapshot/snapshotcreate.yaml b/examples/manila-csi-plugin/nfs/snapshot/snapshotcreate.yaml index cce0ace345..4095cb8f74 100644 --- a/examples/manila-csi-plugin/nfs/snapshot/snapshotcreate.yaml +++ b/examples/manila-csi-plugin/nfs/snapshot/snapshotcreate.yaml @@ -1,9 +1,8 @@ -apiVersion: snapshot.storage.k8s.io/v1alpha1 +apiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshot metadata: name: new-nfs-share-snap spec: - snapshotClassName: csi-manila-nfs + volumeSnapshotClassName: csi-manila-nfs source: - name: new-nfs-share-pvc - kind: PersistentVolumeClaim + persistentVolumeClaimName: new-nfs-share-pvc diff --git a/manifests/manila-csi-plugin/csi-controllerplugin-rbac.yaml b/manifests/manila-csi-plugin/csi-controllerplugin-rbac.yaml index 9da05d017e..e05d8a439b 100644 --- a/manifests/manila-csi-plugin/csi-controllerplugin-rbac.yaml +++ b/manifests/manila-csi-plugin/csi-controllerplugin-rbac.yaml @@ -52,18 +52,15 @@ rules: - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshotclasses"] verbs: ["get", "list", "watch"] + - 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: ["volumesnapshots"] - verbs: ["get", "list", "watch", "update"] - - apiGroups: ["snapshot.storage.k8s.io"] - resources: ["volumesnapshots/status"] + resources: ["volumesnapshotcontents/status"] verbs: ["update"] - - apiGroups: ["apiextensions.k8s.io"] - resources: ["customresourcedefinitions"] - verbs: ["create", "list", "watch", "delete", "get", "update"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 diff --git a/manifests/manila-csi-plugin/csi-controllerplugin.yaml b/manifests/manila-csi-plugin/csi-controllerplugin.yaml index 6fe83c389a..5b8d4ccfb4 100644 --- a/manifests/manila-csi-plugin/csi-controllerplugin.yaml +++ b/manifests/manila-csi-plugin/csi-controllerplugin.yaml @@ -36,7 +36,7 @@ spec: serviceAccountName: openstack-manila-csi-controllerplugin containers: - name: provisioner - image: "quay.io/k8scsi/csi-provisioner:v1.4.0" + image: "quay.io/k8scsi/csi-provisioner:v2.0.2" args: - "--v=5" - "--csi-address=$(ADDRESS)" @@ -50,7 +50,7 @@ spec: - name: plugin-dir mountPath: /var/lib/kubelet/plugins/manila.csi.openstack.org - name: snapshotter - image: "quay.io/k8scsi/csi-snapshotter:v1.2.2" + image: "quay.io/k8scsi/csi-snapshotter:v2.1.1" args: - "--v=5" - "--csi-address=$(ADDRESS)"