Skip to content

Commit

Permalink
upgrade snapshot to v2.0.1
Browse files Browse the repository at this point in the history
https://github.com/kubernetes-csi/external-snapshotter/releases
has a broken update when upgrade to 2.0.0

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
  • Loading branch information
jichenjc committed Mar 18, 2020
1 parent 7491ab5 commit 93d99da
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 17 deletions.
8 changes: 5 additions & 3 deletions docs/using-cinder-csi-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ You should make sure following similar pods are ready before proceed:

```
NAME READY STATUS RESTARTS AGE
csi-cinder-controllerplugin 4/4 Running 0 29h
csi-cinder-nodeplugin 2/2 Running 0 46h
csi-cinder-controllerplugin 5/5 Running 0 29h
csi-cinder-nodeplugin 3/3 Running 0 46h
```

you can get information about CSI Drivers running in a cluster, using **CSIDriver** object
Expand Down Expand Up @@ -195,7 +195,9 @@ Note: `allowedTopologies` can be specified in storage class to restrict the topo
Following prerequisite needed for volume snapshot feature to work.

1. Enable `--feature-gates=VolumeSnapshotDataSource=true` in kube-apiserver
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`
2. Make sure, your csi deployment contains external-snapshotter sidecar container
3. Download yaml files from https://github.com/kubernetes-csi/external-snapshotter/tree/v2.0.1/config/crd
4. Apply all yaml files downloaded at step 3) by using `kubectl apply -f ` command, as currently there is no released yaml file from `external-snapshotter` community.

For Snapshot Creation and Volume Restore, please follow below steps:

Expand Down
5 changes: 3 additions & 2 deletions examples/cinder-csi-plugin/snapshot/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ provisioner: cinder.csi.openstack.org

---

apiVersion: snapshot.storage.k8s.io/v1alpha1
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshotClass
metadata:
name: csi-cinder-snapclass
snapshotter: cinder.csi.openstack.org
driver: cinder.csi.openstack.org
deletionPolicy: Delete

---

Expand Down
7 changes: 3 additions & 4 deletions examples/cinder-csi-plugin/snapshot/snapshotcreate.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
apiVersion: snapshot.storage.k8s.io/v1alpha1
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshot
metadata:
name: new-snapshot-demo
spec:
snapshotClassName: csi-cinder-snapclass
volumeSnapshotClassName: csi-cinder-snapclass
source:
name: pvc-snapshot-demo
kind: PersistentVolumeClaim
persistentVolumeClaimName: pvc-snapshot-demo
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ rules:
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots/status"]
verbs: ["update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["update"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create", "list", "watch", "delete"]
Expand Down
9 changes: 2 additions & 7 deletions manifests/cinder-csi-plugin/cinder-csi-controllerplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,8 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.2.2
args:
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
- name: csi-snapshot-controller
image: quay.io/k8scsi/snapshot-controller:v2.0.1
imagePullPolicy: Always
volumeMounts:
- mountPath: /var/lib/csi/sockets/pluginproxy/
Expand Down
10 changes: 9 additions & 1 deletion manifests/cinder-csi-plugin/cinder-csi-nodeplugin-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "create", "update", "patch"]

- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["update"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
11 changes: 11 additions & 0 deletions manifests/cinder-csi-plugin/cinder-csi-nodeplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ spec:
mountPath: /csi
- name: registration-dir
mountPath: /registration
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v2.0.1
args:
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
imagePullPolicy: Always
volumeMounts:
- mountPath: /var/lib/csi/sockets/pluginproxy/
name: socket-dir
- name: cinder-csi-plugin
securityContext:
privileged: true
Expand Down

0 comments on commit 93d99da

Please sign in to comment.