Skip to content

Commit 66b9eed

Browse files
authored
upgrade snapshot to v2.1.1 (kubernetes#974)
https://github.com/kubernetes-csi/external-snapshotter/releases has a broken update when upgrade to 2.1.1 so the upgrade of the side car container including: 1) upgrade the version 2) honor the split of snapshot controller and snapshotter 3) update rbac 4) update example according to the v1beta1 definition The helm chart is updated as well
1 parent 0fc80b6 commit 66b9eed

File tree

5 files changed

+20
-30
lines changed

5 files changed

+20
-30
lines changed

docs/using-cinder-csi-plugin.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ You should make sure following similar pods are ready before proceed:
122122

123123
```
124124
NAME READY STATUS RESTARTS AGE
125-
csi-cinder-controllerplugin 4/4 Running 0 29h
125+
csi-cinder-controllerplugin 5/5 Running 0 29h
126126
csi-cinder-nodeplugin 2/2 Running 0 46h
127127
```
128128

@@ -248,8 +248,10 @@ Note: `allowedTopologies` can be specified in storage class to restrict the topo
248248

249249
Following prerequisite needed for volume snapshot feature to work.
250250

251-
1. Enable `--feature-gates=VolumeSnapshotDataSource=true` in kube-apiserver
252-
2. Make sure, your csi deployment contains external-snapshotter sidecar container, external-snapshotter sidecar container will create three crd's for snapshot management VolumeSnapshot,VolumeSnapshotContent, and VolumeSnapshotClass. external-snapshotter is a part of `csi-cinder-controllerplugin`
251+
1. Download all yaml files from [snapshot crd](https://github.com/kubernetes-csi/external-snapshotter/tree/v2.1.1/config/crd)
252+
2. Apply all yaml files downloaded at step 1) by using `kubectl apply -f ` command, as currently there is no released yaml file from `external-snapshotter` community.
253+
3. Download all yaml files from [snapshot-controller](https://github.com/kubernetes-csi/external-snapshotter/tree/master/deploy/kubernetes/snapshot-controller) and optionally update all namespaces from `default` to `kube-system` in the yaml files.
254+
4. Apply all yaml files downloaded at step 3) by using `kubectl apply -f ` command.
253255

254256
Supported parameters for VolumeSnapshotClass:
255257
* `force-create`: Support creating snapshot for a volume in in-use status.

examples/cinder-csi-plugin/snapshot/example.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ provisioner: cinder.csi.openstack.org
66

77
---
88

9-
apiVersion: snapshot.storage.k8s.io/v1alpha1
9+
apiVersion: snapshot.storage.k8s.io/v1beta1
1010
kind: VolumeSnapshotClass
1111
metadata:
1212
name: csi-cinder-snapclass
13-
snapshotter: cinder.csi.openstack.org
13+
driver: cinder.csi.openstack.org
14+
deletionPolicy: Delete
1415
parameters:
1516
force-create: "false"
1617

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
apiVersion: snapshot.storage.k8s.io/v1alpha1
1+
apiVersion: snapshot.storage.k8s.io/v1beta1
22
kind: VolumeSnapshot
33
metadata:
44
name: new-snapshot-demo
55
spec:
6-
snapshotClassName: csi-cinder-snapclass
6+
volumeSnapshotClassName: csi-cinder-snapclass
77
source:
8-
name: pvc-snapshot-demo
9-
kind: PersistentVolumeClaim
8+
persistentVolumeClaimName: pvc-snapshot-demo

manifests/cinder-csi-plugin/cinder-csi-controllerplugin-rbac.yaml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,37 +95,25 @@ apiVersion: rbac.authorization.k8s.io/v1
9595
metadata:
9696
name: csi-snapshotter-role
9797
rules:
98-
- apiGroups: [""]
99-
resources: ["persistentvolumes"]
100-
verbs: ["get", "list", "watch"]
101-
- apiGroups: [""]
102-
resources: ["persistentvolumeclaims"]
103-
verbs: ["get", "list", "watch"]
104-
- apiGroups: ["storage.k8s.io"]
105-
resources: ["storageclasses"]
106-
verbs: ["get", "list", "watch"]
10798
- apiGroups: [""]
10899
resources: ["events"]
109100
verbs: ["list", "watch", "create", "update", "patch"]
110-
- apiGroups: [""]
111-
resources: ["secrets"]
112-
verbs: ["get", "list"]
101+
# Secret permission is optional.
102+
# Enable it if your driver needs secret.
103+
# For example, `csi.storage.k8s.io/snapshotter-secret-name` is set in VolumeSnapshotClass.
104+
# See https://kubernetes-csi.github.io/docs/secrets-and-credentials.html for more details.
105+
# - apiGroups: [""]
106+
# resources: ["secrets"]
107+
# verbs: ["get", "list"]
113108
- apiGroups: ["snapshot.storage.k8s.io"]
114109
resources: ["volumesnapshotclasses"]
115110
verbs: ["get", "list", "watch"]
116111
- apiGroups: ["snapshot.storage.k8s.io"]
117112
resources: ["volumesnapshotcontents"]
118113
verbs: ["create", "get", "list", "watch", "update", "delete"]
119114
- apiGroups: ["snapshot.storage.k8s.io"]
120-
resources: ["volumesnapshots"]
121-
verbs: ["get", "list", "watch", "update"]
122-
- apiGroups: ["snapshot.storage.k8s.io"]
123-
resources: ["volumesnapshots/status"]
115+
resources: ["volumesnapshotcontents/status"]
124116
verbs: ["update"]
125-
- apiGroups: ["apiextensions.k8s.io"]
126-
resources: ["customresourcedefinitions"]
127-
verbs: ["create", "list", "watch", "delete"]
128-
129117
---
130118
kind: ClusterRoleBinding
131119
apiVersion: rbac.authorization.k8s.io/v1

manifests/cinder-csi-plugin/cinder-csi-controllerplugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
- name: socket-dir
6060
mountPath: /var/lib/csi/sockets/pluginproxy/
6161
- name: csi-snapshotter
62-
image: quay.io/k8scsi/csi-snapshotter:v1.2.2
62+
image: quay.io/k8scsi/csi-snapshotter:v2.1.1
6363
args:
6464
- "--csi-address=$(ADDRESS)"
6565
env:

0 commit comments

Comments
 (0)