Installing CSI Snapshot Controller
To enable the HPE SimpliVity CSI to take snapshots install the CSI Snapshot Controller on each cluster
Download the yaml files from the GitHub repo of CSI Snapshotter. Refer to the support information page to download the appropriate yamls according to the driver version.
In the below examples we are using namespace kube-system, which is a good place to store infrastructure related resources in Kubernetes.
In setup-snapshot-controller.yaml, update the namespace and image version. The CSI snapshot controller image version should be a compatible version from the table in Support Information.
11 metadata:
12 name: snapshot-controller
13 namespace: kube-system # Use kube-system namespace
14 spec:
27 - name: snapshot-controller
28 image: quay.io/k8scsi/snapshot-controller:v4.0.0
Update the namespace values in rbac-snapshot-controller.yaml
9 kind: ServiceAccount
10 metadata:
11 name: snapshot-controller
12 namespace: kube-system # Use kube-system namespace
13
14 ---
47 kind: ClusterRoleBinding
48 apiVersion: rbac.authorization.k8s.io/v1
49 metadata:
50 name: snapshot-controller-role
51 subjects:
52 - kind: ServiceAccount
53 name: snapshot-controller
54 # replace with non-default namespace name
55 namespace: kube-system # Use kube-system namespace
56 roleRef:
62 kind: Role
63 apiVersion: rbac.authorization.k8s.io/v1
64 metadata:
65 namespace: kube-system # Use kube-system namespace
66 name: snapshot-controller-leaderelection
73 kind: RoleBinding
74 apiVersion: rbac.authorization.k8s.io/v1
75 metadata:
76 name: snapshot-controller-leaderelection
77 namespace: kube-system # Use kube-system namespace
78 subjects:
79 - kind: ServiceAccount
80 name: snapshot-controller
81 namespace: kube-system # Use kube-system namespace
(Optional) Enabling Fault Tolerance
Update "replica" and "leader-election" values in setup-snapshot-controller.yaml
14 spec:
15 serviceName: "snapshot-controller"
16 replicas: 2 # Update value to 2
17 selector:
29 args:
30 - "--v=5"
31 - "--leader-election=true" # Update value to True
32 imagePullPolicy: Always
Install the custom resource definition (CRD) for the Snapshot side car
$ kubectl create -f snapshot.storage.k8s.io_volumesnapshotclasses.yaml
$ kubectl create -f snapshot.storage.k8s.io_volumesnapshotcontents.yaml
$ kubectl create -f snapshot.storage.k8s.io_volumesnapshots.yaml
Install the snapshot-controller
$ kubectl create -f rbac-snapshot-controller.yaml
$ kubectl create -f setup-snapshot-controller.yaml