Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1689963 - s3 bucket does not delete at cluster removal
Summary: s3 bucket does not delete at cluster removal
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 4.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.1.0
Assignee: Oleg Bulatov
QA Contact: Wenjing Zheng
Depends On:
TreeView+ depends on / blocked
Reported: 2019-03-18 14:20 UTC by Ryan Cook
Modified: 2019-04-01 10:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-04-01 10:03:07 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Ryan Cook 2019-03-18 14:20:15 UTC
Description of problem: s3 bucket is not removed at deletion of cluster

Version-Release number of selected component (if applicable): Beta2

How reproducible: create cluster, delete cluster, browse s3 to see bucket still exists

Steps to Reproduce:
1. create cluster
2. remove the cluster
3. go to s3 to see bucket is still there

Actual results: bucket exists after installation removed

Expected results: bucket deleted

Additional info:

Comment 1 Oleg Bulatov 2019-03-27 14:59:25 UTC
> ./bin/openshift-install destroy cluster --dir=./cluster/aws
> ...REDACTED...
> INFO Deleted                                       arn="arn:aws:s3:::image-registry-us-west-1-4ca31fc9029342df807f73a24c56d69f-3d95"

I can't reproduce it with these steps.

Comment 2 Wenjing Zheng 2019-03-28 02:15:35 UTC
If let operator to use a customized bucket, then destroy cluster, check S3 console, both the default and customized buckets exist, they should all be deleted.

Comment 3 Oleg Bulatov 2019-03-28 17:07:12 UTC
Wenjing, what do you mean by "a customized bucket"? Do I need to create it by myself?

I launched a cluster, changed the bucket name field in the config.imageregistry/cluster resource. The operator created a new bucket with the new name and this bucket also had the openshiftClusterID tag (i.e. it was going to be deleted by `openshift-install destroy cluster`).

Still I don't understand why the default bucket doesn't get removed in your case. If you can reproduce it, can you check tags on the bucket before destroying the cluster?

Comment 4 Wenjing Zheng 2019-03-29 10:32:49 UTC
As you know, there will be a default S3 bucket created after cluster is ready, then I try to edit like below:
      bucket: image-registry-ca-central-1-wzheng
      encrypt: true
      region: ca-central-1

There will be a bucket named "image-registry-ca-central-1-wzheng" generated, before the one generated after cluster ready is "image-registry-ca-central-1-3758a46e5f2248798fd2ac56159372a0-2". Then I try to destroy cluster, both of the buckets are not deleted, I still can see them in S3 console. But my cluster is destroyed, all my instances are in terminated state.

Comment 5 Oleg Bulatov 2019-03-29 14:21:44 UTC
Yes, that's exactly what I've tried. Both buckets had the openshiftClusterID tag, and both buckets was deleted by the installer.

> INFO Deleted                                       arn="arn:aws:s3:::image-registry-us-west-1-51ccf178720b4fd2836d54baeca74dd8-aaaa"
> INFO Deleted                                       arn="arn:aws:s3:::image-registry-us-west-1-51ccf178720b4fd2836d54baeca74dd8-6206"

I'm using openshift-install unreleased-master-615-gb3b8a8928b1953c00944fae307c933dbcad6cf75 built from commit b3b8a8928b1953c00944fae307c933dbcad6cf75.

Perhaps it was fixed in the installer v0.15. Which version did you use to reproduce it?

Comment 6 Wenjing Zheng 2019-04-01 09:30:59 UTC
Yes, I can see the buckets get deleted by the installer now, and also cannot see them from S3 console:
level=info msg=Deleted arn="arn:aws:s3:::image-registry-ca-central-1-0730ff8951c94b43b32617535f1cdf22-a"
level=info msg=Deleted arn="arn:aws:s3:::image-registry-ca-central-1-wzheng"

But I do see they exist last week, anyway, now is the good news, I think this bug can be closed as not a bug.

Comment 7 Oleg Bulatov 2019-04-01 10:03:07 UTC
Wenjing, thanks for confirmation.

Note You need to log in before you can comment on or make changes to this bug.