Delete persistent storage

To maintain the health and performance of your Google Distributed Cloud (GDC) air-gapped environment, you can delete unused persistent storage for container workloads. You manage this persistent storage as PersistentVolumeClaim (PVC) resources and remove claims from a Kubernetes cluster by using the kubectl CLI.

Developers within the application operator group use these steps to manage application workloads for their organization. For more information, see Audiences for GDC air-gapped documentation.

Before you begin

To complete the tasks in this document, you must request the necessary permissions.

Request IAM roles

You must have specific roles to get the permissions you need to delete a persistent volume. The roles you require depend on whether you are working within an organization-scoped shared cluster or project-scoped standard cluster. For more information, see Kubernetes cluster configurations.

Shared cluster roles

To create, delete, edit, or view persistent volumes in a shared cluster, ask your IAM Project Admin to grant you the Namespace Admin (namespace-admin) role. This role is bound to your project namespace.

Standard cluster roles

To create, delete, edit, or view persistent volumes in a standard cluster, ask your IAM Project Admin to grant you the Cluster Developer (cluster-developer) role. This role is bound to your project namespace.

Delete a persistent volume

To delete a PVC, complete the following:

  1. List the existing PVCs in your project namespace:

    kubectl get pvc -n NAMESPACE
    

    Replace NAMESPACE with the namespace in your Kubernetes cluster. If your PVC is in a shared cluster, use your project namespace.

    Note the PVC that you want to delete.

  2. Delete the PVC:

    kubectl delete pvc PVC_NAME -n NAMESPACE
    

    Replace the following:

    • PVC_NAME: the name of the PVC to delete.

    • NAMESPACE: the namespace in your Kubernetes cluster. If your PVC is in a shared cluster, use your project namespace.

    The output is similar to the following:

    persistentvolumeclaim "test-pvc" deleted
    

What's next