Deleting a bucket
If you have a bucket and it is empty, you can delete it.
Warning
Before deleting the bucket, delete all its objects, including their previous versions and delete markers, and complete or terminate multipart uploads. You cannot delete a bucket that contains such data. If a version is protected with Object Lock, consider the mode and lock period.
-
Get a list of buckets in the project:
kubectl get bucket -n <project_name> -
Make sure the bucket is empty. Delete all objects and their versions via the S3 API if you no longer need them. To check versions, delete markers, and incomplete multipart uploads, use the AWS CLI with the access key:
aws --endpoint-url=https://storage.sys.<cluster_domain> s3api list-object-versions \ --bucket <bucket_name> aws --endpoint-url=https://storage.sys.<cluster_domain> s3api list-multipart-uploads \ --bucket <bucket_name>Deleting an object from a bucket with versioning in a regular way does not delete previous versions and creates a delete marker. You need to delete them as well before deleting the bucket.
-
Delete the bucket resource:
kubectl delete bucket <bucket_name> -n <project_name> -
Make sure the bucket was deleted:
kubectl get bucket -n <project_name>
- If you have not opened a project yet, select one.
- In the left-hand menu, select Object Storage.
- Select the bucket.
- Click Delete bucket.
- Confirm the deletion.
If you cannot check bucket contents because you cannot access the storage, deletion will be rejected. Repeat the request after regaining access. If the resource switched to DeletionFailed, get the error description in the status.message field:
kubectl get bucket <bucket_name> -n <project_name> -o yaml