Skip to main content
After a dynamic or static persistent volume is provisioned, workloads use persistent storage through PVCs. The PVC and the workload must be in the same namespace, and the PVC status must be Bound.

Reference a PVC in a Workload

Complete the following configuration in the workload’s Pod template:
  • Reference the PVC through persistentVolumeClaim.claimName in spec.volumes.
  • Set the volume name and mount directory in the container’s volumeMounts.
The following Pod mounts the PVC named training-data-pvc to the container’s /data directory.
Replace namespace, image, mountPath, and claimName with actual values. Workloads such as Deployments, StatefulSets, and Jobs can also use the same volumes and volumeMounts configuration in their Pod templates.

Submit and confirm the mount result

  1. Log in to the GPU Cloud console and go to the Clusters page.
  2. Click the name of the target cluster to go to the cluster workspace.
  3. In the left navigation pane, go to the Workloads page, select the appropriate workload type, and submit the YAML.
  4. Verify that the workload is running properly and that the container can read and write data through the target mount directory. If a Pod remains in Pending for an extended period or a container cannot start, check whether the PVC is Bound, whether the PVC and workload are in the same namespace, and whether claimName is correct.

Unmount PVC

Before deleting a PVC, remove all workload references to the PVC:
  • For workloads managed by controllers such as Deployment, StatefulSet, and Job, update the Pod template and remove the corresponding volumeMounts and volumes configurations.
  • For directly created Pods, stop and delete the Pod, or recreate it using a configuration that no longer references the PVC.
After confirming that no running Pods are using the PVC, handle the PVC and PV based on how the storage volume was created or bound.