Skip to content

Commit 48a6405

Browse files
Bharath KaimalBharath Kaimal
authored andcommitted
creation of limit ranges page
1 parent af2a5b3 commit 48a6405

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Limit Ranges
2+
3+
In an OpenShift Container Platform cluster, containers run with unlimited compute resources. By using limit ranges, you can restrict the amount of resources consumed for the following objects within a project.
4+
5+
- Pods/Containers: You can set minimum and maximum requirements for CPU and memory
6+
7+
- Image Streams: You can set limits on the number of images and tags in an _ImageStream_ object
8+
9+
- Images: You can limit the size of images that can be pushed to a registry
10+
11+
- Persistent Volume Claims (PVC): You can restrict the size of the PVCs that can be requested
12+
13+
A _LimitRange_ object allows you to restrict the amount of resources that can be consumed in a project. Any request that is made to create or modify a resource will be validated against any _LimitRange_ objects in the project. If any of the constraints listed in the _LimitRange_ object are violated, then the resource request is rejected.
14+
15+
## Creating a Limit Range
16+
17+
To create a _LimitRange_ object you can follow the example below:
18+
19+
```
20+
apiVersion: "v1"
21+
kind: "LimitRange"
22+
metadata:
23+
name: "resource-limits"
24+
spec:
25+
limits:
26+
- type: "Pod"
27+
max:
28+
cpu: "2"
29+
memory: "1Gi"
30+
min:
31+
cpu: "200m"
32+
memory: "6Mi"
33+
- type: "Container"
34+
max:
35+
cpu: "2"
36+
memory: "1Gi"
37+
min:
38+
cpu: "100m"
39+
memory: "4Mi"
40+
default:
41+
cpu: "300m"
42+
memory: "200Mi"
43+
defaultRequest:
44+
cpu: "200m"
45+
memory: "100Mi"
46+
maxLimitRequestRatio:
47+
cpu: "10"
48+
- type: openshift.io/Image
49+
max:
50+
storage: 1Gi
51+
- type: openshift.io/ImageStream
52+
max:
53+
openshift.io/image-tags: 20
54+
openshift.io/images: 30
55+
- type: "PersistentVolumeClaim"
56+
min:
57+
storage: "2Gi"
58+
max:
59+
storage: "50Gi"
60+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ nav:
9090
- <div class="sub-section">Secrets</div>: openshift/configuration/secrets/index.md
9191
- <div class="sub-section">Security Contexts</div>: openshift/configuration/security-contexts/index.md
9292
- <div class="sub-section">Service Accounts</div>: openshift/configuration/service-accounts/index.md
93+
- <div class="sub-section">Limit Ranges</div>: openshift/configuration/limit-ranges/index.md
9394
- <div class="header">Deployments</div>:
9495
- openshift/deployments/index.md
9596
- <div class="sub-section">Rolling Updates</div>: openshift/deployments/updates/index.md

0 commit comments

Comments
 (0)