Creating a quota
Written by
Updated at April 8, 2026
After creating a project, the administrator can limit resources using the ResourceQuota object
Using the CLI
-
Create a file of the
ResourceQuotaresource, e.g., using thetouch resourcequota.yamlcommand. -
Open the file and paste the configuration below into it:
Quota without scopeQuota with scopeapiVersion: v1 kind: ResourceQuota metadata: name: example-quota spec: hard: requests.cpu: '2' # Requested CPUs: 2 limits.cpu: '4' # CPU limit: 4 requests.memory: '1' # Requested RAM: 1 GB limits.memory: '10' # RAM limit: 10 GB requests.nvidia.com/gpu: 1 # Requested GPUs: 1Note
The quota will only be applied to pods with the
priorityClassName: middleproperty.apiVersion: v1 kind: ResourceQuota metadata: name: priority-class-quota spec: hard: limits.cpu: '10' # CPU limit: 10 limits.memory: '20' # RAM limit: 20 GB requests.cpu: '5' # Requested CPU: 5 requests.memory: '10' # Requested RAM: 10 GB scopeSelector: matchExpressions: - scopeName: PriorityClass operator: In values: - middle -
Apply the manifest:
kubectl apply -f resourcequota.yaml -n <project name>. Optionally, you can specify the project name in themetadata.namespaceresource property and skip it in the command.
Using the management console
- If you have not opened a project yet, select one.
- Go to the Quotas tab on the project description page.
- Click Add quota.
- Enter a name for the quota.
- Specify values for the
limits.cpuandrequests.cpufields or select other resources. - To apply the quota to the entire project, delete the text from the Scope field. Otherwise, the quota will only be applied to pods with the
priorityClassName: middleproperty. Optionally, instead of deleting the text, you can change the scope to what is required to apply the quota. - Click Save.