Delete storage buckets

You can remove unused object storage buckets in Google Distributed Cloud (GDC) air-gapped appliance by emptying each bucket with the gdcloud CLI and deleting it with the kubectl CLI. Deleting unneeded buckets helps you manage your storage lifecycle and maintain data hygiene.

This document is for IT administrators within the platform administrator group and developers within the application operator group who manage object storage resources in GDC air-gapped appliance environments.

Before you begin

A project namespace manages bucket resources in the management API server. You must have a project to work with buckets and objects.

You must also have the appropriate bucket permissions to perform the following operation. See Grant bucket access.

To run commands against the management API server, sign in and generate the kubeconfig file for the management API server if you don't have one.

You can delete storage buckets by using the kubectl CLI. Buckets must be empty before you can delete them.

  1. Use the GET or DESCRIBE command to get the fully qualified bucket name.

  2. If the bucket is not empty, empty the bucket:

    gdcloud storage rm --recursive s3://FULLY_QUALIFIED_BUCKET_NAME
    
  3. Delete the empty bucket:

    kubectl delete buckets/BUCKET_NAME --namespace NAMESPACE_NAME