[vagrant@master01 external-snapshotter]$ kubectl kustomize client/config/crd | kubectl create -f - customresourcedefinition.apiextensions.k8s.io/volumesnapshotclasses.snapshot.storage.k8s.io created customresourcedefinition.apiextensions.k8s.io/volumesnapshotcontents.snapshot.storage.k8s.io created customresourcedefinition.apiextensions.k8s.io/volumesnapshots.snapshot.storage.k8s.io created
安装 Snapshot Controller:
1 2 3 4 5 6 7
[vagrant@master01 external-snapshotter]$ kubectl -n kube-system kustomize deploy/kubernetes/snapshot-controller | kubectl create -f - serviceaccount/snapshot-controller created role.rbac.authorization.k8s.io/snapshot-controller-leaderelection created clusterrole.rbac.authorization.k8s.io/snapshot-controller-runner created rolebinding.rbac.authorization.k8s.io/snapshot-controller-leaderelection created clusterrolebinding.rbac.authorization.k8s.io/snapshot-controller-role created deployment.apps/snapshot-controller created
验证:
1 2 3
[vagrant@master01 external-snapshotter]$ kubectl get deployment.apps/snapshot-controller -n kube-system NAME READY UP-TO-DATE AVAILABLE AGE snapshot-controller 2/2 2 2 55s
安装 CSI 驱动:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
[vagrant@master01 external-snapshotter]$ kubectl kustomize deploy/kubernetes/csi-snapshotter | kubectl create -f - serviceaccount/csi-provisioner created serviceaccount/csi-snapshotter created role.rbac.authorization.k8s.io/external-provisioner-cfg created role.rbac.authorization.k8s.io/external-snapshotter-leaderelection created clusterrole.rbac.authorization.k8s.io/external-provisioner-runner created clusterrole.rbac.authorization.k8s.io/external-snapshotter-runner created rolebinding.rbac.authorization.k8s.io/csi-provisioner-role-cfg created rolebinding.rbac.authorization.k8s.io/csi-snapshotter-provisioner-role-cfg created rolebinding.rbac.authorization.k8s.io/external-snapshotter-leaderelection created clusterrolebinding.rbac.authorization.k8s.io/csi-provisioner-role created clusterrolebinding.rbac.authorization.k8s.io/csi-snapshotter-provisioner-role created clusterrolebinding.rbac.authorization.k8s.io/csi-snapshotter-role created service/csi-snapshotter created statefulset.apps/csi-snapshotter created
验证:
1 2 3
[vagrant@master01 external-snapshotter]$ kubectl get statefulset.apps/csi-snapshotter NAME READY AGE csi-snapshotter 1/1 2m13s
--- apiVersion:snapshot.storage.k8s.io/v1 kind:VolumeSnapshotClass metadata: name:csi-rbdplugin-snapclass driver:rook-ceph.rbd.csi.ceph.com# csi-provisioner-name parameters: # Specify a string that identifies your cluster. Ceph CSI supports any # unique string. When Ceph CSI is deployed by Rook use the Rook namespace, # for example "rook-ceph". clusterID:rook-ceph# namespace:cluster csi.storage.k8s.io/snapshotter-secret-name:rook-csi-rbd-provisioner csi.storage.k8s.io/snapshotter-secret-namespace:rook-ceph# namespace:cluster deletionPolicy:Delete
应用并验证:
1 2 3 4 5 6
[vagrant@master01 rbd]$ kubectl apply -f snapshotclass.yaml volumesnapshotclass.snapshot.storage.k8s.io/csi-rbdplugin-snapclass created
[vagrant@master01 rbd]$ kubectl get volumesnapshotclass NAME DRIVER DELETIONPOLICY AGE csi-rbdplugin-snapclass rook-ceph.rbd.csi.ceph.com Delete 19s
--- apiVersion:snapshot.storage.k8s.io/v1 kind:VolumeSnapshotClass metadata: name:csi-cephfsplugin-snapclass driver:rook-ceph.cephfs.csi.ceph.com# csi-provisioner-name parameters: # Specify a string that identifies your cluster. Ceph CSI supports any # unique string. When Ceph CSI is deployed by Rook use the Rook namespace, # for example "rook-ceph". clusterID:rook-ceph# namespace:cluster csi.storage.k8s.io/snapshotter-secret-name:rook-csi-cephfs-provisioner csi.storage.k8s.io/snapshotter-secret-namespace:rook-ceph# namespace:cluster deletionPolicy:Delete
应用并检查:
1 2 3 4 5 6
[vagrant@master01 cephfs]$ kubectl apply -f snapshotclass.yaml volumesnapshotclass.snapshot.storage.k8s.io/csi-cephfsplugin-snapclass created [vagrant@master01 cephfs]$ kubectl get volumesnapshotclass NAME DRIVER DELETIONPOLICY AGE csi-cephfsplugin-snapclass rook-ceph.cephfs.csi.ceph.com Delete 6s csi-rbdplugin-snapclass rook-ceph.rbd.csi.ceph.com Delete 55m
评论· · · · · ·