Skip to content

Commit 986eb55

Browse files
author
Brice Fallon-Freeman
authored
Merge pull request #3084 from markturansky/add_storage_limits
Added storage to limits and quota
2 parents b33f7bf + 7b1e7a0 commit 986eb55

File tree

2 files changed

+88
-3
lines changed

2 files changed

+88
-3
lines changed

admin_guide/limits.adoc

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ toc::[]
1717
A limit range, defined by a `*LimitRange*` object, enumerates
1818
xref:../dev_guide/compute_resources.adoc#dev-compute-resources[compute resource
1919
constraints] in a xref:../dev_guide/projects.adoc#dev-guide-projects[project] at the pod,
20-
container, image and image stream level, and specifies the amount of resources
21-
that a pod, container, image or image stream can consume.
20+
container, image, image stream, and persistent volume claim level, and specifies the amount of resources
21+
that a pod, container, image, image stream, or persistent volume claim can consume.
2222

2323
All resource create and modification requests are evaluated against each
2424
`*LimitRange*` object in the project. If the resource violates any of the
@@ -314,6 +314,68 @@ distinguished.
314314

315315
// end::admin_limits_image_stream_limits[]
316316

317+
318+
[[claim-limits]]
319+
=== PersistentVolumeClaim Limits
320+
321+
// tag::admin_limits_claim_limits[]
322+
*Supported Resources:*
323+
324+
* Storage
325+
326+
*Supported Constraints:*
327+
328+
Across all persistent volume claims in a project, the following must hold true:
329+
330+
.Pod
331+
[cols="3a,8a",options="header"]
332+
|===
333+
334+
|Constraint |Enforced Behavior
335+
336+
|`*Min*`
337+
|Min[resource] <= claim.spec.resources.requests[resource] (required)
338+
339+
|`*Max*`
340+
|claim.spec.resources.requests[resource] (required) <= Max[resource]
341+
342+
[[limit-range-def]]
343+
344+
.Limit Range Object Definition
345+
====
346+
347+
|===
348+
349+
[source,json]
350+
----
351+
{
352+
"apiVersion": "v1",
353+
"kind": "LimitRange",
354+
"metadata": {
355+
"name": "pvcs" <1>
356+
},
357+
"spec": {
358+
"limits": [{
359+
"type": "PersistentVolumeClaim",
360+
"min": {
361+
"storage": "2Gi", <2>
362+
},
363+
"max": {
364+
"storage": "50Gim", <3>
365+
}
366+
},
367+
}]
368+
}
369+
}
370+
----
371+
<1> The name of the limit range document.
372+
<2> The minimum amount of storage that can be requested in a persistent volume claim
373+
<3> The maximum amount of storage that can be requested in a persistent volume claim
374+
====
375+
376+
// end::admin_limits_claim_limits[]
377+
378+
317379
[[creating-a-limit-range]]
318380
== Creating a Limit Range
319381

admin_guide/quota.adoc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ toc::[]
1717
A resource quota, defined by a `*ResourceQuota*` object, provides constraints
1818
that limit aggregate resource consumption per project. It can limit the quantity
1919
of objects that can be created in a project by type, as well as the total amount
20-
of compute resources that may be consumed by resources in that project.
20+
of compute resources and storage that may be consumed by resources in that project.
2121
// end::admin_quota_overview[]
2222

2323
ifdef::openshift-origin,openshift-enterprise,openshift-dedicated[]
@@ -61,6 +61,11 @@ interchangeably.
6161
exceed this value. `*memory*` and `*requests.memory*` are the same value and can
6262
be used interchangeably.
6363

64+
|`*requests.storage*`
65+
|Across all persistent volume claim in any state, the sum of storage requests cannot
66+
exceed this value. `*storage*` and `*requests.storage*` are the same value and can
67+
be used interchangeably.
68+
6469
|`*limits.cpu*`
6570
|Across all pods in a non-terminal state, the sum of CPU limits cannot exceed
6671
this value.
@@ -339,6 +344,24 @@ spec:
339344
<4> Restricts the quota to only matching pods where `spec.activeDeadlineSeconds >=0`. For example,
340345
this quota would charge for build or deployer pods, but not long running pods like a web server or database.
341346
====
347+
348+
.*storage-consumption.yaml*
349+
====
350+
----
351+
apiVersion: v1
352+
kind: ResourceQuota
353+
metadata:
354+
name: storage-consumption
355+
spec:
356+
hard:
357+
persistentvolumeclaims: "10" <1>
358+
requests.storage: "50Gi" <2>
359+
----
360+
<1> The total number of persistent volume claims in a project
361+
<2> Across all persistent volume claims in a project, the sum of storage requested cannot exceed this value.
362+
====
363+
364+
342365
// end::admin_quota_sample_definitions[]
343366

344367
[[create-a-quota]]

0 commit comments

Comments
 (0)