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

[cinder-csi-plugin] upgrade snapshot to v2.1.1 #974

Merged
merged 1 commit into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/using-cinder-csi-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ 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-controllerplugin 5/5 Running 0 29h
csi-cinder-nodeplugin 2/2 Running 0 46h
```

Expand Down Expand Up @@ -207,8 +207,10 @@ 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`
1. Download all yaml files from [snapshot crd](https://github.com/kubernetes-csi/external-snapshotter/tree/v2.1.1/config/crd)
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.
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.
4. Apply all yaml files downloaded at step 3) by using `kubectl apply -f ` command.

Supported parameters for VolumeSnapshotClass:
* `force-create`: Support creating snapshot for a volume in in-use status.
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
parameters:
force-create: "false"

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
28 changes: 8 additions & 20 deletions manifests/cinder-csi-plugin/cinder-csi-controllerplugin-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,37 +95,25 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-snapshotter-role
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
# Secret permission is optional.
# Enable it if your driver needs secret.
# For example, `csi.storage.k8s.io/snapshotter-secret-name` is set in VolumeSnapshotClass.
# See https://kubernetes-csi.github.io/docs/secrets-and-credentials.html for more details.
# - apiGroups: [""]
# resources: ["secrets"]
# verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotclasses"]
verbs: ["get", "list", "watch"]
- 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"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.2.2
image: quay.io/k8scsi/csi-snapshotter:v2.1.1
args:
- "--csi-address=$(ADDRESS)"
env:
Expand Down