Skip to content

Commit 6aacf80

Browse files
authored
Merge pull request #13470 from adellape/quotas
Add quota docs to v4
2 parents 8ce04ce + 7d4a5f8 commit 6aacf80

20 files changed

+933
-4
lines changed

_topic_map.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ Topics:
151151
File: creating-project-other-user
152152
Distros: openshift-enterprise,openshift-origin
153153
---
154+
Name: Administering clusters
155+
Dir: administering_clusters
156+
Distros: openshift-origin, openshift-enterprise
157+
Topics:
158+
- Name: Setting quotas per project
159+
File: quotas-setting-per-project
160+
- Name: Setting quotas across multiple projects
161+
File: quotas-setting-across-multiple-projects
162+
---
154163
Name: Networking
155164
Dir: networking
156165
Distros: openshift-*
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[id='setting-quotas-across-multiple-projects']
2+
= Setting quotas across multiple projects
3+
{product-author}
4+
{product-version}
5+
:data-uri:
6+
:icons:
7+
:experimental:
8+
:toc: macro
9+
:toc-title:
10+
:prewrap!:
11+
:context: setting-quotas-across-multiple-projects
12+
13+
toc::[]
14+
15+
{nbsp} +
16+
A multi-project quota, defined by a `ClusterResourceQuota` object, allows quotas
17+
to be shared across multiple projects. Resources used in each selected project
18+
will be aggregated and that aggregate will be used to limit resources across all
19+
the selected projects.
20+
21+
include::modules/quotas-selecting-projects.adoc[leveloffset=+1]
22+
include::modules/quotas-viewing-clusterresourcequotas.adoc[leveloffset=+1]
23+
include::modules/quotas-selection-granularity.adoc[leveloffset=+1]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[id='quotas-setting-per-project']
2+
= Setting quotas per project
3+
{product-author}
4+
{product-version}
5+
:data-uri:
6+
:icons:
7+
:experimental:
8+
:toc: macro
9+
:toc-title:
10+
:prewrap!:
11+
:context: quotas-setting-per-project
12+
13+
toc::[]
14+
15+
{nbsp} +
16+
A resource quota, defined by a `ResourceQuota` object, provides constraints that
17+
limit aggregate resource consumption per project. It can limit the quantity of
18+
objects that can be created in a project by type, as well as the total amount of
19+
compute resources and storage that may be consumed by resources in that project.
20+
21+
include::modules/quotas-resources-managed.adoc[leveloffset=+1]
22+
include::modules/quotas-scopes.adoc[leveloffset=+1]
23+
include::modules/quotas-enforcement.adoc[leveloffset=+1]
24+
include::modules/quotas-requests-vs-limits.adoc[leveloffset=+1]
25+
include::modules/quotas-sample-resource-quotas-def.adoc[leveloffset=+1]
26+
include::modules/quotas-creating-a-quota.adoc[leveloffset=+1]
27+
include::modules/quotas-creating-object-count-quotas.adoc[leveloffset=+2]
28+
include::modules/setting-resource-quota-for-extended-resources.adoc[leveloffset=+2]
29+
include::modules/quotas-viewing-quotas.adoc[leveloffset=+1]
30+
include::modules/quotas-configuring-quota-sync-period.adoc[leveloffset=+1]
31+
include::modules/quotas-requiring-explicit-quota.adoc[leveloffset=+1]

masters/PLACEHOLDER

Lines changed: 0 additions & 2 deletions
This file was deleted.

masters/images

Lines changed: 0 additions & 1 deletion
This file was deleted.

masters/modules

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * administering_clusters/quotas-setting-per-project.adoc
4+
5+
[id='quotas-configuring-quota-sync-period']
6+
[[]]
7+
= Configuring quota synchronization period
8+
9+
When a set of resources are deleted, but before quota usage is restored, a user
10+
might encounter problems when attempting to reuse the resources. The
11+
synchronization time frame of resources is determined by the
12+
`resource-quota-sync-period` setting, which can be configured by a cluster
13+
administrator.
14+
15+
Adjusting the regeneration time can be helpful for creating resources and
16+
determining resource usage when automation is used.
17+
18+
[NOTE]
19+
====
20+
The `resource-quota-sync-period` setting is designed to balance system
21+
performance. Reducing the sync period can result in a heavy load on the master.
22+
====
23+
24+
.Procedure
25+
26+
To configure the quota synchronization period:
27+
28+
. Change the `resource-quota-sync-period` setting to have the set of resources
29+
regenerate at the desired amount of time (in seconds) and for the resources to
30+
be available again:
31+
+
32+
[source,yaml]
33+
----
34+
kubernetesMasterConfig:
35+
apiLevels:
36+
- v1beta3
37+
- v1
38+
apiServerArguments: null
39+
controllerArguments:
40+
resource-quota-sync-period:
41+
- "10s"
42+
----
43+
44+
. Restart the master services to apply the changes:
45+
+
46+
----
47+
# master-restart api
48+
# master-restart controllers
49+
----

modules/quotas-creating-a-quota.adoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * administering_clusters/quotas-setting-per-project.adoc
4+
5+
[id='quotas-creating-a-quota']
6+
= Creating a quota
7+
8+
You can create a quota to constrain resource usage in a given project.
9+
10+
.Procedure
11+
12+
. Define the quota in a file. See
13+
xref:../administering_clusters/quotas-setting-per-project.adoc#quotas-sample-resource-quota-definitions[Sample resource quota definitions]
14+
for examples.
15+
16+
. Use the file to create the quota and apply it to a project:
17+
+
18+
----
19+
$ oc create -f <file> [-n <project_name>]
20+
----
21+
+
22+
For example:
23+
+
24+
----
25+
$ oc create -f core-object-counts.yaml -n demoproject
26+
----
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * administering_clusters/quotas-setting-per-project.adoc
4+
5+
[id='quota-creating-object-count-quotas-{context}']
6+
== Creating object count quotas
7+
8+
You can create an object count quota for all {product-title} standard namespaced
9+
resource types, such as `BuildConfig`, and `DeploymentConfig`. An object quota
10+
count places a defined quota on all standard namespaced resource types.
11+
12+
When using a resource quota, an object is charged against the quota if it exists
13+
in server storage. These types of quotas are useful to protect against
14+
exhaustion of storage resources.
15+
16+
.Procedure
17+
18+
To configure an object count quota for a resource:
19+
20+
. Run the following command:
21+
+
22+
----
23+
$ oc create quota <name> \
24+
--hard=count/<resource>.<group>=<quota>,count/<resource>.<group>=<quota> <1>
25+
----
26+
<1> `<resource>` is the name of the resource, and `<group>` is the API group, if
27+
applicable. Use the `kubectl api-resources` command for a list of resources and
28+
their associated API groups.
29+
+
30+
For example:
31+
+
32+
----
33+
$ oc create quota test \
34+
--hard=count/deployments.extensions=2,count/replicasets.extensions=4,count/pods=3,count/secrets=4
35+
resourcequota "test" created
36+
----
37+
+
38+
This example limits the listed resources to the hard limit in each project in
39+
the cluster.
40+
41+
. Verify that the quota was created:
42+
+
43+
----
44+
$ oc describe quota test
45+
Name: test
46+
Namespace: quota
47+
Resource Used Hard
48+
-------- ---- ----
49+
count/deployments.extensions 0 2
50+
count/pods 0 3
51+
count/replicasets.extensions 0 4
52+
count/secrets 0 4
53+
----

modules/quotas-enforcement.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * administering_clusters/quotas-setting-per-project.adoc
4+
5+
[id='quota-enforcement-{context}']
6+
= Quota enforcement
7+
8+
After a resource quota for a project is first created, the project restricts the
9+
ability to create any new resources that may violate a quota constraint until it
10+
has calculated updated usage statistics.
11+
12+
After a quota is created and usage statistics are updated, the project accepts
13+
the creation of new content. When you create or modify resources, your quota
14+
usage is incremented immediately upon the request to create or modify the
15+
resource.
16+
17+
When you delete a resource, your quota use is decremented during the next full
18+
recalculation of quota statistics for the project. A configurable amount of time
19+
determines how long it takes to reduce quota usage statistics to their current
20+
observed system value.
21+
22+
If project modifications exceed a quota usage limit, the server denies the
23+
action, and an appropriate error message is returned to the user explaining the
24+
quota constraint violated, and what their currently observed usage statistics
25+
are in the system.

0 commit comments

Comments
 (0)