# Kubernetes StorageClass and PVC

## Configuring Kubernetes Storage

You can configure the Storage Class and Persistent Volume Claims (PVCs) from the DuploCloud Portal.

In the DuploCloud Portal, navigate to **Kubernetes** -> **Storage**. The **Kubernetes Storage** page displays.

You define your Kubernetes Persistent Volume Claims and Storage Classes from this page.

## Creating a Storage Class

1. DuploCloud Portal, navigate to **Kubernetes** -> **Storage**.
2. Click **Add**. The **Add Kubernetes Storage Class** page displays.
3. Define the Storage Class **Name**, **Provisioner**, **Reclaim Policy**, and **Volume Binding Mode.** Select other options, such as whether to **Allow Volume Expansion**.
4. Create a Storage Class, as in the example below.
5. For EKS, you can create EFS following [these steps](/docs/automation-platform/overview/aws-services/elastic-file-system-efs.md).

<figure><img src="/files/0wfozRlhQRkWwWx080UK" alt=""><figcaption><p><strong>Add Kubernetes Storage Class</strong> page for EKS in AWS</p></figcaption></figure>

<figure><img src="/files/G11UzrWymlLak1DAfsvV" alt=""><figcaption><p><strong>Add Kubernetes Storage Class</strong> page for AKS in Azure</p></figcaption></figure>

{% hint style="info" %}
For information on using Native Azure StorageClasses, [see this section](/docs/automation-platform/kubernetes-overview/kubernetes-storageclass-and-pvc/storage-options.md).
{% endhint %}

## Creating Kubernetes Persistent Volume Claim

DuploCloud Portal, navigate to **Kubernetes** -> **Storage**.

The **Persistent Volume Claims** option is selected by default.

<figure><img src="/files/KB9SI2WwCSZW8SJDWkfZ" alt=""><figcaption><p>The <strong>Persistent Volume Claims</strong> option on the <strong>Kubernetes Storage</strong> page</p></figcaption></figure>

Click **Add**. The **Add Kubernetes Persistent Volume Claim** page displays.

<div align="left"><figure><img src="/files/wGITvelxEYG521lKoPeA" alt=""><figcaption><p>The <strong>Add Kubernetes Persistent Volume Claim</strong> page</p></figcaption></figure></div>

3. Define the PVC **Name**, **Storage Class Name**, **Volume Name**, **Volume Mode**, and other details such as volume **Access Modes**.
4. Optionally, to group resources in the Kubernetes Apps dashboard, add an app name in the **Labels** field, in the following format:

   ```
   Key: app.duplocloud.net/app-name
   Value: <app name>
   ```
5. Click **Add**.

{% hint style="warning" %}
If you are using K8s and PVCs to autoscale your storage groups and you encounter out-of-space conditions, 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:

* [Managing Volume Expansions in StatefulSets on GKE](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/volume-expansion#managing_volume_expansions_in_statefulsets)
* [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 %}


---

# 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/kubernetes-overview/kubernetes-storageclass-and-pvc.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.
