# Storage Class and PVCs

### **Step 1:** Create an Amazon EFS

Refer to steps [here](https://docs.duplocloud.com/docs/automation-platform/overview/aws-services/elastic-file-system-efs)

### Step 2: Create Storage Class with EFS Parameter

Navigate to **Kubernetes** -> **Storage** -> **Storage Class**

Configure EFS parameter created at Step1 by clicking on EFS Parameter.

![K8s Storage Class Page](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FHcQCRdCvnIFg3Qcw4UfX%2Fimage.png?alt=media\&token=90c1ff0a-c1c4-47de-b2ed-f46ce405625e)

### Step 3: Create Persistent Volume (PVC) using Storage Class

Here, we are configuring Kubernetes to use Storage Class created in Step 2 above, to create a Persistent Volume with 10Gi of storage capacity and ReadWriteMany access mode.

![K8s Storage Class (Persistent Volume Claim Tab)](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FZh19b08qmtBe8qjcJg1C%2Fimage.png?alt=media\&token=56926cbe-c8f2-4b5f-9e95-881809962b7d)

{% hint style="warning" %}
if you use K8s and PVCs to autoscale your storage groups and run out of space, simply adding new storage volumes may not resolve the issue. Instead, you must increase the size of the existing PVCs to accommodate your storage needs.

For guidance on how to perform volume expansion in Kubernetes, refer to the following resources:

* [Increasing Disk Size in a StatefulSet](https://serverfault.com/questions/955293/how-to-increase-disk-size-in-a-stateful-set)
* [Expanding Persistent Volume Claims in Kubernetes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#expanding-persistent-volumes-claims)
* [Expanding Kubernetes Persistent Volumes on EKS](https://www.jeffgeerling.com/blog/2019/expanding-k8s-pvs-eks-on-aws)
  {% endhint %}

### Step 4: Mount PVC to the POD Deployment

Configure below in **Volumes** to create your application deployment using this PVC.

{% code title="Volumes field" %}

```
# Deployment using PersistentVolumeClaim. 
- Name: <volumne name>
  Path: <mount path>
  Spec:
    PersistentVolumeClaim:
      claimName: <pvc name>
```

{% endcode %}

<figure><img src="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FAr5LzpOz7HjmeaF03YWu%2Fscreenshot-nimbusweb.me-2024.02.19-16_11_54.png?alt=media&#x26;token=0c1898b2-fbc0-4017-b430-bf6b1bd64489" alt=""><figcaption><p>Services Page</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.duplocloud.com/docs/automation-platform/overview/aws-services/storage/adding-k8s-storage-class.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
