githubEdit

Setting Up a Persistent Volume Using EFS

How to set up a persistent volume using EFS

Configure an Amazon EFS volume in DuploCloud and connect it to Kubernetes workloads through a Persistent Volume Claim (PVC), allowing your workloads to share storage across pods and persist data across container restarts and redeployments.

Step 1: Create an EFS in DuploCloud

  1. In the DuploCloud Portal, navigate to Cloud Services Storage EFS.

  2. Click Add. The Add Elastic File System pane displays.

    Add Elastic File System pane
  3. Complete the fields as follows:

Name

Enter a name for the EFS.

Performance Mode

Select General Purpose.

Throughput Mode

Select Bursting.

Enable Backup

Select Disabled.

Enable Encryption

Select Enable.

  1. Click Submit.

Step 2: Create a Storage Class

  1. In the DuploCloud Portal, go to Kubernetes Storage Storage Class.

  2. Click Add. The Add Kubernetes Storage Class pane displays.

    Add Kubernetes Storage Class pane
  3. Complete the fields as follows:

Name

Enter a name for the storage class.

Provisioner

Select efs.csi.aws.com.

Reclaim Policy

Select Delete.

Volume Binding Mode

Select Immediate.

Parameters

Click Set EFS parameters, and in the File System Id field, select the EFS created in Step 1.

  1. Click Add.

Step 3: Create a Persistent Volume Claim (PVC)

  1. In the DuploCloud Portal, navigate to Kubernetes Storage Persistent Volume Claims.

  2. Click Add. The Add Kubernetes Persistent Volume Claim pane displays.

    Add Kubernetes Persistent Volume Claim pane
  3. Complete the fields as follows:

Name

Enter a name for the PVC.

Storage Class Name

Select the storage class created in Step 2.

Volume Name

Enter the same name you entered for the PVC in the Name field.

Volume Mode

Select Filesystem.

Access Modes

Select ReadWriteMany.

Resources

Enter the storage size you need (default is 10Gi).

  1. Click Add.

Step 4: Update Service Configuration

Update your Service configuration to include the new PVC.

  1. Navigate to Kubernetes -> Services.

  2. For the Service that needs the volume, click on the menu icon () and select Edit.

  3. Click Next.

  4. Update the Volumes field as shown in the example YAML snippet below.

    Edit Service pane with PVC configurations in the Volumes field
  1. Click Update to apply the changes to the Service.

  2. Restart the Service and ensure the Pod restarts and mounts the volume successfully.

circle-info

Note: Restarting the Service is required for changes to take effect. Plan for a brief downtime during this configuration.

Last updated

Was this helpful?