Setting resource quota
Set resource quota to limit the sum of compute and storage resources that can be requested by an application. Resource quotas can also be used to limit the number of objects of a specified type that is available in a single namespace.
For more information about setting resource quota, see Resource Quotas on the Kubernetes concepts page .
To view a list of quotas, from the navigation menu, click Manage > Quotas.
Required user type or access level: Cluster administrator or team administrator
Creating a quota by using the Create ResourceQuota window
- From the navigation menu, click Manage > Quotas.
- Click Create ResourceQuota.
- Enter the resource quota details.
- Click Create.
Creating a quota by using the "Create resource" window
- From the dashboard, click Create resource.
-
Copy and paste a YAML or JSON file into the "Create resource" dialog box. For more information about creating a quota by using a YAML file, see https://kubernetes.io/docs/concepts/policy/resource-quotas/#viewing-and-setting-quotas .
When creating a quota from the "Create resource" window, remember to specify the namespace in the
metadata
section.For GPU resource quotas, you can set resource requests for specific namespaces by running the
requests.nvidia.com/gpu
parameter.The following sample code sets a GPU request quota of 2 GPUs for the
myspace
namespace.apiVersion: v1 kind: ResourceQuota metadata: name: compute-resources namespace: myspace spec: hard: requests.cpu: "1" requests.memory: 1Gi limits.cpu: "2" limits.memory: 2Gi requests.nvidia.com/gpu: "2"
Note: Due to Kubernetes limitation, you must set requests.nvidia.com/gpu
to allow the GPU quota to set resource requests.
- Click Create.
After the deployment completes, a new quota is displayed on the Quotas page.