Persistent Volume Claims
Persistent Volume Claims (or PVCs) are objects that request storage resources from your cluster. They’re similar to a voucher that your deployment can redeem for storage access. When you create a deployment, you should usually attach a PVC so that your application can lay claim to persistent storage. This claim lets your deployment application store its data in an external location, so that if one of the application’s containers fails, it can be replaced with a new container and continue accessing its data stored externally, as though an outage never occurred.
- Rancher lets you create as many PVCs within a project as you’d like.
- You can mount PVCs to a deployment as you create it, or later after its running.
- Each Rancher project contains a list of PVCs that you’ve created, available from the Volumes tab. You can reuse these PVCs when creating deployments in the future.
From the Global view, open the project containing a workload that you want to add a PVC to.
From the main menu, make sure that Workloads is selected. Then select the Volumes tab. Click Add Volume.
Enter a Name for the volume claim.
Select the Namespace of the volume claim.
Select a Source option:
To dynamically provision a storage volume for the deployment:
Choose Use a Storage Class to provision a new persistent volume
From the Storage Class drop-down, choose a pre-created storage class.
Enter a volume Capacity.
To use an existing persistent volume:
Choose Use an existing persistent volume:
From the Persistent Volume drop-down, choose a pre-created persistent volume.
Optional: From Customize, select the Access Modes that you want to use.
Result: Your PVC is created. You can now attach it to any workload in the project.