mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
deploy: add support for nfs snapshot
This commit add external-snapshotter container and required rbac to support nfs snaphots. Example volumesnaphotclass, volumesnapshot, pvc-restore and pod-restore yamls are also added. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
17
examples/nfs/pod-restore.yaml
Normal file
17
examples/nfs/pod-restore.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: csi-nfs-restore-demo-pod
|
||||
spec:
|
||||
containers:
|
||||
- name: web-server
|
||||
image: docker.io/library/nginx:latest
|
||||
volumeMounts:
|
||||
- name: mypvc
|
||||
mountPath: /var/lib/www
|
||||
volumes:
|
||||
- name: mypvc
|
||||
persistentVolumeClaim:
|
||||
claimName: nfs-pvc-restore
|
||||
readOnly: false
|
16
examples/nfs/pvc-restore.yaml
Normal file
16
examples/nfs/pvc-restore.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: nfs-pvc-restore
|
||||
spec:
|
||||
storageClassName: csi-nfs-sc
|
||||
dataSource:
|
||||
name: nfs-pvc-snapshot
|
||||
kind: VolumeSnapshot
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
9
examples/nfs/snapshot.yaml
Normal file
9
examples/nfs/snapshot.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
apiVersion: snapshot.storage.k8s.io/v1
|
||||
kind: VolumeSnapshot
|
||||
metadata:
|
||||
name: nfs-pvc-snapshot
|
||||
spec:
|
||||
volumeSnapshotClassName: csi-nfsplugin-snapclass
|
||||
source:
|
||||
persistentVolumeClaimName: csi-nfs-pvc
|
23
examples/nfs/snapshotclass.yaml
Normal file
23
examples/nfs/snapshotclass.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
apiVersion: snapshot.storage.k8s.io/v1
|
||||
kind: VolumeSnapshotClass
|
||||
metadata:
|
||||
name: csi-nfsplugin-snapclass
|
||||
driver: nfs.csi.ceph.com
|
||||
parameters:
|
||||
# String representing a Ceph cluster to provision storage from.
|
||||
# Should be unique across all Ceph clusters in use for provisioning,
|
||||
# cannot be greater than 36 bytes in length, and should remain immutable for
|
||||
# the lifetime of the StorageClass in use.
|
||||
# Ensure to create an entry in the configmap named ceph-csi-config, based on
|
||||
# csi-config-map-sample.yaml, to accompany the string chosen to
|
||||
# represent the Ceph cluster in clusterID below
|
||||
clusterID: <cluster-id>
|
||||
|
||||
# Prefix to use for naming CephFS snapshots.
|
||||
# If omitted, defaults to "csi-snap-".
|
||||
# snapshotNamePrefix: "foo-bar-"
|
||||
|
||||
csi.storage.k8s.io/snapshotter-secret-name: csi-cephfs-secret
|
||||
csi.storage.k8s.io/snapshotter-secret-namespace: default
|
||||
deletionPolicy: Delete
|
Reference in New Issue
Block a user