Usually application owner or project owner will specify the quota settings (Memory and CPU) during project creation. But sometimes, they realize that the requested resource is not enough to run their applications.
Usually we name the quota with its specifications and not a good idea to edit this existing quota. Standard practice is to remove/delete the quota for the project and recreate new quota with new values.
Note : You must set quota together with limit.
# oc get quota -n myproject
NAME AGE
proj-quota-8gi 284d
# oc describe quota proj-quota-8gi -n myproject
Name: proj-quota-8gi
Namespace: myproject
Resource Used Hard
-------- ---- ----
requests.cpu 4726m 5400m
requests.memory 7000Mi 8Gi
WARNING : mention project namespace to avoid any accidental quota delete.
# oc delete quota proj-quota-32gi -n myproject
This is the template file where we mention the memory and CPU quota details.
# cat proj-quota-32Gi_no_limit.yaml
apiVersion: v1
kind: ResourceQuota
metadata:
creationTimestamp: null
name: proj-quota-32gi
spec:
hard:
requests.cpu: 19200m
requests.memory: 32Gi
# oc create -f proj-quota-32Gi_no_limit.yaml -n PROJECT_NAME
# oc get quota -n myproject
NAME AGE
proj-quota-32gi 1d
# oc describe quota proj-quota-32gi -n myproject
Name: proj-quota-32gi
Namespace: myproject
Resource Used Hard
-------- ---- ----
requests.cpu 5513m 19200m
requests.memory 10724Mi 32Gi
]# oc describe project myproject |grep Quota -A5
Quota:
Name: proj-quota-32gi
Resource Used Hard
-------- ---- ----
requests.cpu 5513m 19200m
requests.memory 10724Mi 32Gi
That’s it.
Disclaimer: The views expressed and the content shared are those of the author and do not reflect the views of the author’s employer or techbeatly platform.
Gineesh Madapparambath
Gineesh Madapparambath is the founder of techbeatly and he is the author of the book - ๐๐ป๐๐ถ๐ฏ๐น๐ฒ ๐ณ๐ผ๐ฟ ๐ฅ๐ฒ๐ฎ๐น-๐๐ถ๐ณ๐ฒ ๐๐๐๐ผ๐บ๐ฎ๐๐ถ๐ผ๐ป.
He has worked as a Systems Engineer, Automation Specialist, and content author. His primary focus is on Ansible Automation, Containerisation (OpenShift & Kubernetes), and Infrastructure as Code (Terraform).
(aka Gini Gangadharan - iamgini.com)
This site uses Akismet to reduce spam. Learn how your comment data is processed.2 Responses
Leave a Reply Cancel reply
For what OCP version is this template applicable?
It was OCP 3.9 while I was writing this article (in 2018)
Check latest docs for details : https://docs.openshift.com/container-platform/4.9/applications/quotas/quotas-setting-per-project.html