I have a Google App Engine app, which connects to Google Cloud Storage.
I noticed that the amount of data stored was unreasonably high (4.01 GB, when it should be 100MB or so).
So, I looked at how much each bucket was storing, and I found that there was an automatically created bucket called us.artificats.
that was taking up most of the space.
I looked inside, and all it has is one folder: containers/images/
.
From what I've Googled, it seems like these images come from Google Cloud Build.
My question is, can I delete them without compromising my entire application?
In the Google Cloud console, go to the Cloud Storage Buckets page. Select the checkbox of the bucket you want to delete. Click Delete.
[HOSTNAME] is the location where the image is hosted, and is one of four options: gcr.io , us.gcr.io , eu.gcr.io , or asia.gcr.io . [PROJECT-ID] is the Google Cloud console project ID. If your project ID has a colon in it ( : ) see Domain-scoped projects. [IMAGE] is the image's name in Container Registry.
In the Google Cloud console, go to the Manage resources page. In the project list, select the project that you want to delete, and then click Delete. In the dialog, type the project ID, and then click Shut down to delete the project.
For those of you seeing this later on, I ended up deleting the folder, and everything was fine.
When I ran Google Cloud Build again, it added items back into the bucket, which I had to delete later on.
As @HarshitG mentioned, this can be set up to happen automatically via deletion rules in cloud storage. As for myself, I added a deletion step to my deployment GitHub action.
I have solved this problem by applying a deletion rule. Here's how to do it:
Now all objects older than 3 days will be automatically deleted. It might take a few minutes for this new rule to be applied by Google Cloud.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With