This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 14. Resource Quota
14.1. Overview 링크 복사링크가 클립보드에 복사되었습니다!
A ResourceQuota object enumerates hard resource usage limits per project. It limits the total number of a particular type of object that may be created in a project, and the total amount of compute resources that may be consumed by resources in that project.
14.2. Usage Limits 링크 복사링크가 클립보드에 복사되었습니다!
The following describes the set of limits that may be enforced by a ResourceQuota.
Resource Name | Description |
---|---|
| Total cpu usage across all containers |
| Total memory usage across all containers |
| Total number of pods |
| Total number of replication controllers |
| Total number of resource quotas |
| Total number of services |
| Total number of secrets |
| Total number of persistent volume claims |
14.3. Quota Enforcement 링크 복사링크가 클립보드에 복사되었습니다!
After a project quota is first created, the project restricts the ability to create any new resources that may violate a quota constraint until it has calculated updated usage statistics.
Once a quota is created and usage statistics are up-to-date, the project accepts the creation of new content. When you create or modify resources, your quota usage is incremented immediately upon the request to create or modify the resource. When you delete a resource, your quota use is decremented during the next full recalculation of quota statistics for the project. When you delete resources, a configurable amount of time determines how long it takes to reduce quota usage statistics to their current observed system value.
If project modifications exceed a quota usage limit, the server denies the action, and an appropriate error message is returned to the end-user explaining the quota constraint violated, and what their currently observed usage stats are in the system.
14.4. Sample Resource Quota File 링크 복사링크가 클립보드에 복사되었습니다!
resource-quota.json
- 1
- The name of this quota document
- 2
- The total amount of memory consumed across all containers may not exceed 1Gi.
- 3
- The total number of cpu usage consumed across all containers may not exceed 20 Kubernetes compute units.
- 4
- The total number of pods in the project
- 5
- The total number of services in the project
- 6
- The total number of replication controllers in the project
- 7
- The total number of resource quota documents in the project
14.5. Create a Quota 링크 복사링크가 클립보드에 복사되었습니다!
To apply a quota to a project:
oc create -f resource-quota.json
$ oc create -f resource-quota.json
14.6. View a Quota 링크 복사링크가 클립보드에 복사되었습니다!
To view usage statistics related to any hard limits defined in your quota:
14.7. Configuring the Quota Synchronization Period 링크 복사링크가 클립보드에 복사되었습니다!
When a set of resources are deleted, the synchronization timeframe of resources is determined by the resource-quota-sync-period
setting in the /etc/openshift/master/master-config.yaml file. Before your quota usage is restored, you may encounter problems when attempting to reuse the resources. Change the resource-quota-sync-period
setting to have the set of resources regenerate at the desired amount of time (in seconds) and for the resources to be available again:
Adjusting the regeneration time can be helpful for creating resources and determining resource usage when automation is used.
The resource-quota-sync-period
setting is designed to balance system performance. Reducing the sync period can result in a heavy load on the master.