Persistent Volumes & Storage Claims
By default, container filesystems are ephemeral. To store research inputs, beamline raw data, and trained model weights, you must create a PersistentVolumeClaim (PVC).
1. Creating a CephFS PersistentVolumeClaim
Section titled “1. Creating a CephFS PersistentVolumeClaim”CephFS provides a POSIX-compliant distributed filesystem that supports ReadWriteMany (RWX), allowing hundreds of pods to read and write to the same volume simultaneously.
Create cephfs-claim.yaml:
apiVersion: v1kind: PersistentVolumeClaimmetadata: name: lab-shared-data-pvc namespace: sci-myprojectspec: accessModes: - ReadWriteMany storageClassName: cephfs-sc resources: requests: storage: 500GiApply the claim:
kubectl apply -f cephfs-claim.yamlkubectl get pvc -n sci-myproject2. Mounting PVC into a Pod
Section titled “2. Mounting PVC into a Pod”apiVersion: v1kind: Podmetadata: name: analysis-worker namespace: sci-myprojectspec: containers: - name: app image: python:3.11-slim command: ["bash", "-c", "echo 'Experiment data logged' >> /mnt/shared/results.log && sleep 3600"] volumeMounts: - name: dataset-mount mountPath: /mnt/shared volumes: - name: dataset-mount persistentVolumeClaim: claimName: lab-shared-data-pvc