Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- apiVersion: v1
- kind: PersistentVolume
- metadata:
- # Can be anything, but has to be matched at line 47
- # Also should avoid conflicts with existing PV names in the namespace
- name: preprov-pv-cephfs-01
- spec:
- accessModes:
- - ReadWriteMany
- capacity:
- storage: 5Gi
- csi:
- driver: rook-ceph.cephfs.csi.ceph.com
- nodeStageSecretRef:
- name: rook-ceph-csi
- namespace: rook-ceph
- volumeAttributes:
- clusterID: rook-ceph
- fsName: myfs
- # The key "staticVolume" states this is pre-provisioned
- # NOTE: This was "preProvisionedVolume: "true"" in Ceph-CSI versions 1.0 and below
- staticVolume: "true"
- # Path of the PV on the CephFS filesystem
- rootPath: /staticpvs/pv-1
- # Can be anything, need not match PV name, or volumeName in PVC
- # Retained as the same for simplicity and uniquness
- volumeHandle: preprov-pv-cephfs-01
- # Reclaim policy must be "retain" as,
- # deletion of pre-provisioned volumes is not supported
- persistentVolumeReclaimPolicy: Retain
- volumeMode: Filesystem
- claimRef:
- # Name should match "claimName" in PVC claim section
- name: csi-cephfs-pvc-preprov
- namespace: default
- ---
- apiVersion: v1
- kind: PersistentVolumeClaim
- metadata:
- name: csi-cephfs-pvc-preprov
- spec:
- accessModes:
- - ReadWriteMany
- resources:
- requests:
- storage: 5Gi
- volumeName: preprov-pv-cephfs-01
- ---
- apiVersion: v1
- kind: Pod
- metadata:
- name: csicephfs-preprov-demo-pod
- spec:
- containers:
- - image: busybox
- name: busybox
- command:
- - sleep
- - "3600"
- imagePullPolicy: IfNotPresent
- volumeMounts:
- - name: mypvc
- mountPath: /mnt
- volumes:
- - name: mypvc
- persistentVolumeClaim:
- claimName: csi-cephfs-pvc-preprov
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement