> [!CAUTION]
> You are currently viewing version 1.3 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions).

<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.3 (unsupported)</button>

- Supported versions:
- [v1.17 (latest)](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/expand-persistent-volumes.md.txt)
- [v1.16](https://docs.cloud.google.com/apigee/docs/hybrid/v1.16/expand-persistent-volumes.md.txt)
- [v1.15](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/expand-persistent-volumes.md.txt)
- [v1.14](https://docs.cloud.google.com/apigee/docs/hybrid/v1.14/expand-persistent-volumes.md.txt)
- [List of supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions)
- Unsupported versions:
- [v1.13](https://docs.cloud.google.com/apigee/docs/hybrid/v1.13/expand-persistent-volumes.md.txt)
- [v1.12](https://docs.cloud.google.com/apigee/docs/hybrid/v1.12/expand-persistent-volumes.md.txt)
- [v1.11](https://docs.cloud.google.com/apigee/docs/hybrid/v1.11/expand-persistent-volumes.md.txt)
- [v1.10](https://docs.cloud.google.com/apigee/docs/hybrid/v1.10/expand-persistent-volumes.md.txt)
- [v1.9](https://docs.cloud.google.com/apigee/docs/hybrid/v1.9/expand-persistent-volumes.md.txt)
- [v1.8](https://docs.cloud.google.com/apigee/docs/hybrid/v1.8/expand-persistent-volumes.md.txt)
- [v1.7](https://docs.cloud.google.com/apigee/docs/hybrid/v1.7/expand-persistent-volumes.md.txt)
- [v1.6](https://docs.cloud.google.com/apigee/docs/hybrid/v1.6/expand-persistent-volumes.md.txt)
- [v1.5](https://docs.cloud.google.com/apigee/docs/hybrid/v1.5/expand-persistent-volumes.md.txt)
- [v1.4](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/expand-persistent-volumes.md.txt)
- [v1.3](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/expand-persistent-volumes.md.txt)
- [v1.2](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/expand-persistent-volumes.md.txt)
- [v1.1](https://docs.cloud.google.com/apigee/docs/hybrid/v1.1/expand-persistent-volumes.html)

This process allows you to expand the persistent volumes used by the Apigee hybrid Cassandra
database to accommodate greater storage needs without needing to create new nodes just to provide
more storage.

## Overview

The Apigee hybrid `cassandra` component uses persistent volumes to store data. The size
of the persistent volume is defined during installation and initial configuration. This initial
storage size is an immutable value and cannot be changed. Therefore, any new node added to the cluster
will use the same persistent volume size.

It is possible to increase the size of the existing persistent volume by making the changes directly on
the Persistent volume Claim, but new nodes will still use the smaller initial persistent volume size.

If your hybrid Cassandra database is nearing its storage capacity, you can use this procedure
to expand the existing persistent volumes and allow new nodes to expand their persistent volumes as
well.

> [!NOTE]
> **Note:** This process only applies to Kubernetes storage classes that support PersistentVolume expansion. See the **[Allow
> Volume Expansion list](https://kubernetes.io/docs/concepts/storage/storage-classes/#allow-volume-expansion)** in the Kubernetes documentation.
>
>
> If you do not know what storage class your hybrid installation uses, you can check with
> the following command.
>
> ```
> kubectl -n apigee get sc standard -o json | grep 'provisioner'
> ```
>
>
> The output will look something like:
>
> ```
>     "provisioner": "kubernetes.io/gce-pd",
> ```
>
>
> Where `gce-pd` is an abbreviation for the *gcePersistentDisk* storage class.
> You can find a list of storage class abbreviations in the **[Parameters
> list](https://kubernetes.io/docs/concepts/storage/storage-classes/#parameters)** in the Kubernetes documentation.

## Expand Cassandra persistent volumes

1. Update the volume size to the desired size:

   ```
   kubectl -n apigee edit pvc
   ```
2. Check the updated volume capacity:

   ```
    kubectl get pvc -n apigee
   ```

   ```
   NAME                                STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
   cassandra-data-apigee-cassandra-default-0   Bound    pvc-92234ba7-941b-4dab-82c6-8a5288a2c8d4   100Gi      RWO            standard       21m
   cassandra-data-apigee-cassandra-default-1   Bound    pvc-6be911fc-91f7-465d-a02e-933428ee10b2   100Gi      RWO            standard       20m
   cassandra-data-apigee-cassandra-default-2   Bound    pvc-14ba34e4-fd5c-4d59-8413-a331dcad3404   100Gi      RWO            standard       19m
   ```
3. Set replicas to `0` for `apigee-controller-manager` deployments in the `apigee-system` namespace:
   1.

      ```
      kubectl get deployments -n apigee-system
      ```

      ```
      NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
      apigee-controller-manager   1/1     1            1           28m
      ```
   2.

      ```
      kubectl edit deployments -n apigee-system apigee-controller-manager
      ```
   3.

      ```
      kubectl get deployments -n apigee-system
      ```

      ```
      NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
      apigee-controller-manager   0/0     0            0           30m
      ```
4. Delete STS without cascade deletion:
   1.

      ```
      kubectl -n apigee delete sts --cascade=false apigee-cassandra
      ```
   2.

      ```
      kubectl get sts -n apigee
      ```

      ```
      No resources found in apigee namespace.
      ```
5. Update the your overrides file with new volume size that you specified when you edited the pvc:

   ```
   cassandra:
     storage:
       capacity: 100Gi
   ```
6. Apply the updated configuration to the cluster:

   ```
   ../apigeectl apply --datastore -f overrides/overrides.yaml
   ```

   ```
   Parsing file: config/values.yaml
   Parsing file: overrides/overrides.yaml
   cleansing older AD's (v1alpha1) istio resources...

   Invoking "kubectl apply" with YAML config...

   apigeedatastore.apigee.cloud.google.com/apigee-cassandra unchanged
   ```
7. Update the controller deployment replicas to previous their state (`` `1` ``):

   ```
   kubectl edit deployments -n apigee-system apigee-controller-manager
   ```
8. Check if the newly created sts has the updated storage size:

   ```
   kubectl get sts -n apigee apigee-cassandra -o yaml |grep storage
   ```

   ```
   storage: 100Gi
   ```
9.
   Check if C\* pods data volume got updated with new size:

   ```
   kubectl exec -n apigee -it apigee-cassandra-default-0 -- df -h|grep "/opt/apigee/data"
   ```

   ```
   /dev/sdb         99G   69M   99G   1% /opt/apigee/data
   ```