Cyber Deals - Get up to 65% off on CKA, CKAD, CKS, KCNA, KCSA exams and courses!

How to Create, Increase or Decrease Project Quota in OpenShift

How to Create, Increase or Decrease Project Quota in OpenShift
Image Credit : https://www.joc.com
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.

Check current quota

# 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

Delete the Quota

WARNING : mention project namespace to avoid any accidental quota delete.

# oc delete quota proj-quota-32gi -n myproject

Create new Quota Template

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

Create new Quota from Template

# oc create -f proj-quota-32Gi_no_limit.yaml -n PROJECT_NAME

Verify new Quota

# 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.

Gineesh Madapparambath

Gineesh Madapparambath

Gineesh Madapparambath is the founder of techbeatly. He is the co-author of The Kubernetes Bible, Second Edition and the author of Ansible for Real Life Automation. 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). (Read more: iamgini.com)


Disclaimer: Views expressed in articles are those of the respective authors and do not necessarily reflect the views of their employers or this site. While we aim for accuracy, please verify information before relying on it, and let us know if you spot an error.
Share:

Related Posts

Play with Ansible Playbooks

Play with Ansible Playbooks

Plays are ordered set of tasks to execute against host selections from your inventory. A playbook is a file containing one or more plays. See...

How to install racadm for iDRAC on RHEL / Linux

How to install racadm for iDRAC on RHEL / Linux

Dell has a beautiful tool for remote server management called iDRAC which is almost same like HPE iLO, but with different features. You can access...

Managing Ansible Inventory

Managing Ansible Inventory

Inventory File An inventory file is a simple and plain text file where we store those host information ansible has to deal with. It can...

How To Create A New User In iDRAC Via Local RACADM From Linux

How To Create A New User In iDRAC Via Local RACADM From Linux

There might be situations like you forgot or lost your iDRAC login credentials and you don’t have an option to access iDRAC since the server...

Installing Ansible

Installing Ansible

You may refer installation doc from official document as well. Requirement Controlnodes Controlnode is just the machine where we install the Ansible …

Running Ansible Ad-Hoc commands

Running Ansible Ad-Hoc commands

We have already run few ad-hoc command to list down the hosts in earlier sections. See all parts of Automation with Ansible Guides here Let’s...