Create PVC across Kubernetes workers#
HA MSR requires a Persistent Volume Claim (PVC) that can be shared across all worker nodes.
Note
MSR 4 can use any StorageClass and PVC that you configure on your
Kubernetes cluster. The following example sets cephfs up as your
default StorageClass. For more information, see
Storage Classes
in the official Kubernetes documentation.
- Create a StorageClass, the specifics of which depend on the storage backend you are using. The following example illustrates how to create a StorageClass class with a CephFS backend and Ceph CSI:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: cephfs
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: cephfs.csi.ceph.com
parameters:
clusterID: <cluster-id>
-
Run
kubectl applyto apply the StorageClass configuration to the cluster, in the appropriate namespace. -
Create the PVC:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: shared-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
storageClassName: cephfs
The `.spec.storageClassName` references the name of the
`StorageClass` you created above.
- Run
kubectl applyto apply PVC to the cluster, in the appropriate namespace.