google cloud platform – Set limit on maximum size of bucket in GCP

You cannot set a limit on the size of a Cloud Storage bucket using Google Cloud management controls or constraints.

Additionally, buckets used by Container Registry and Artifact Registry are best left alone. If you want to control the size, delete images that you are no longer using manually. Do not delete objects as images consist of multiple objects (image layers). A container image is usually not a single file (object). Poor management will result in orphan objects and broken services that use those images.

Technically, you can write your own function to monitor those buckets. Please reread the previous paragraph to understand the challenges in managing the total used space.

Read more here: Source link