Managing quota limits for storage and pull traffic in Container Registry
You can limit the amount of storage and pull traffic that can be used in your IBM Cloud account by setting and managing custom quota limits in IBM Cloud® Container Registry.
Setting quota limits for storing and pulling images
You can limit the amount of storage and pull traffic to your private images by setting your own quota limits.
When you upgrade to the IBM Cloud Container Registry standard plan, you benefit from unlimited amount of storage and pull traffic to your private images. To avoid exceeding your preferred payment level, you can set individual quotas for the amount of storage and pull traffic. Quota limits are applied to all namespacesA collection of repositories that store images in a registry. A namespace is associated with an IBM Cloud account, which can include multiple namespaces. that you set up in IBM Cloud Container Registry. If you're using the free service plan, you can also set custom quotas within your free amount of storage and pull traffic.
To set a quota, complete the following steps.
-
Log in to IBM Cloud.
ibmcloud login
-
Review your current quota limits for storage and pull traffic.
ibmcloud cr quota
Your output looks similar to the following example.
Getting quotas and usage for the current month, for account '<account_owner> Account'... QUOTA LIMIT USED Pull traffic 5.1 GB 0 B Storage 512 MB 511 MB OK
-
Change the quota limit for storage and pull traffic. To change the pull traffic usage, specify the traffic option, and replace
<traffic_quota>
with the value in megabytes that you want to set for the pull traffic quota. If you want to change the amount of storage in your account, specify the storage option, and replace<storage_quota>
with the value in megabytes that you want to set.If you are on the free plan, you cannot set your quota to an amount that exceeds the free tier. The free tier allowance for storage is 512 MB and traffic is 5120 MB.
ibmcloud cr quota-set --traffic <traffic_quota> --storage <storage_quota>
Example to set your quota limit for storage to 600 megabytes, and the pull traffic to 7000 megabytes:
ibmcloud cr quota-set --storage 600 --traffic 7000
Reviewing quota limits and usage
You can review your quota limits and check your current storage and pull traffic usage for your account.
-
Log in to IBM Cloud.
ibmcloud login
-
Review your current quota limits for storage and pull traffic.
ibmcloud cr quota
Your output looks similar to the following example.
Getting quotas and usage for the current month, for account '<account_owner> Account'... QUOTA LIMIT USED Pull traffic 5.1 GB 0 B Storage 512 MB 511 MB OK
Staying within quota limits
If you exceed the quota limits that are set for your IBM Cloud account, you can free up storage and change your service plan or quota limits so that you can continue pushing and pulling images to and from your namespace.
From 1 February 2022, both tagged and untagged images are charged for.
To free up image storage in your IBM Cloud account, complete the following steps.
Depending on the proportions of the image, it might take a while for the image to be removed and for the storage to be available.
-
Find the names of the images that you want to remove.
-
To list only tagged images, run the
ibmcloud cr image-list
command. Combine the content of the Repository column (repository
) and Tag column (tag
) separated by a colon (:
) to create the image name in the formatrepository:tag
. If the listing images command times out, see Why is it timing out when I list images? for assistance.ibmcloud cr image-list
-
To list both tagged and untagged images, you must list the images by digest in all your namespaces of your IBM Cloud account. To list the images by digest, run the
ibmcloud cr image-digests
command. Combine the content of the Repository column (repository
) and the Digest column (digest
) separated by an at (@
) symbol to create the image name in the formatrepository@digest
.ibmcloud cr image-digests
-
-
You can remove images individually, collectively, or by using retention policies.
-
To remove images individually from your namespace, use the
ibmcloud cr image-rm
command. Replace<image_name>
with the name of the image that you want to remove. The name must be in the formatrepository@digest
orrepository:tag
. If a tag is not specified in the image name, the image that is taggedlatest
is deleted by default. Deleted images are stored in the trash for 30 days. Images that are in the trash don't count toward your quota.You can remove both tagged and untagged images by using the format
repository@digest
. You can remove only tagged images by using the formatrepository:tag
.ibmcloud cr image-rm <image_name>
Where multiple tags exist for the same image digest within a repository, the
ibmcloud cr image-rm
command removes the underlying image and all its tags. If the same image exists in a different repository or namespace, that copy of the image is not removed. If you want to remove a tag from an image and leave the underlying image and any other tags in place, see Removing tags from images in your private repository command. -
To remove untagged images collectively from your namespace, use the
ibmcloud cr image-prune-untagged
command, see Clean up your namespaces by deleting untagged images. -
To use retention policies, see Cleaning up your namespaces.
-
-
Review your storage quota usage.
ibmcloud cr quota
-
To reduce your pull traffic usage, you must wait until the next billing period.
To continue pulling images from your namespaces, choose between the following options.
- Wait until the next billing cycle starts.
- If you have a free plan, upgrade to the standard service plan.
- If you already have a standard plan, set new quota limits for the pull traffic.