mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
Add snapshot yaml files and volume clone
capabilities to provisioner. Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This commit is contained in:
parent
b71a9bfe40
commit
5b512cd48c
@ -27,9 +27,21 @@ rules:
|
|||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["endpoints"]
|
resources: ["endpoints"]
|
||||||
verbs: ["get", "create", "update"]
|
verbs: ["get", "create", "update"]
|
||||||
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||||
|
resources: ["volumesnapshots"]
|
||||||
|
verbs: ["get", "list", "watch", "update"]
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources: ["configmaps"]
|
resources: ["configmaps"]
|
||||||
verbs: ["get", "list", "create", "delete"]
|
verbs: ["get", "list", "create", "delete"]
|
||||||
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||||
|
resources: ["volumesnapshotcontents"]
|
||||||
|
verbs: ["create", "get", "list", "watch", "update", "delete"]
|
||||||
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
||||||
|
resources: ["volumesnapshotclasses"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: ["apiextensions.k8s.io"]
|
||||||
|
resources: ["customresourcedefinitions"]
|
||||||
|
verbs: ["create"]
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: ClusterRoleBinding
|
kind: ClusterRoleBinding
|
||||||
|
@ -38,6 +38,21 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: socket-dir
|
- name: socket-dir
|
||||||
mountPath: /var/lib/kubelet/plugins/csi-rbdplugin
|
mountPath: /var/lib/kubelet/plugins/csi-rbdplugin
|
||||||
|
- name: csi-snapshotter
|
||||||
|
image: quay.io/k8scsi/csi-snapshotter:v1.0.1
|
||||||
|
args:
|
||||||
|
- "--csi-address=$(ADDRESS)"
|
||||||
|
- "--connection-timeout=15s"
|
||||||
|
- "--v=5"
|
||||||
|
env:
|
||||||
|
- name: ADDRESS
|
||||||
|
value: /var/lib/kubelet/plugins/csi-rbdplugin/csi-provisioner.sock
|
||||||
|
imagePullPolicy: Always
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: socket-dir
|
||||||
|
mountPath: /var/lib/kubelet/plugins/csi-rbdplugin
|
||||||
- name: csi-rbdplugin
|
- name: csi-rbdplugin
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
17
examples/rbd/pod-restore.yaml
Normal file
17
examples/rbd/pod-restore.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: csirbd-restore-demo-pod
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: web-server
|
||||||
|
image: nginx
|
||||||
|
volumeMounts:
|
||||||
|
- name: mypvc
|
||||||
|
mountPath: /var/lib/www/html
|
||||||
|
volumes:
|
||||||
|
- name: mypvc
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: rbd-pvc-restore
|
||||||
|
readOnly: false
|
||||||
|
|
16
examples/rbd/pvc-restore.yaml
Normal file
16
examples/rbd/pvc-restore.yaml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: rbd-pvc-restore
|
||||||
|
spec:
|
||||||
|
storageClassName: csi-rbd
|
||||||
|
dataSource:
|
||||||
|
name: rbd-pvc-snapshot
|
||||||
|
kind: VolumeSnapshot
|
||||||
|
apiGroup: snapshot.storage.k8s.io
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
9
examples/rbd/snapshot.yaml
Normal file
9
examples/rbd/snapshot.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: snapshot.storage.k8s.io/v1alpha1
|
||||||
|
kind: VolumeSnapshot
|
||||||
|
metadata:
|
||||||
|
name: rbd-pvc-snapshot
|
||||||
|
spec:
|
||||||
|
snapshotClassName: csi-rbdplugin-snapclass
|
||||||
|
source:
|
||||||
|
name: rbd-pvc
|
||||||
|
kind: PersistentVolumeClaim
|
11
examples/rbd/snapshotclass.yaml
Normal file
11
examples/rbd/snapshotclass.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: snapshot.storage.k8s.io/v1alpha1
|
||||||
|
kind: VolumeSnapshotClass
|
||||||
|
metadata:
|
||||||
|
name: csi-rbdplugin-snapclass
|
||||||
|
snapshotter: csi-rbdplugin
|
||||||
|
parameters:
|
||||||
|
pool: rbd
|
||||||
|
monitors: mon1:port,mon2:port,...
|
||||||
|
csi.storage.k8s.io/snapshotter-secret-name: csi-rbd-secret
|
||||||
|
csi.storage.k8s.io/snapshotter-secret-namespace: default
|
Loading…
Reference in New Issue
Block a user