OpenShift Quicktip: Limiting resource consumption for users

A. Resource limits

Resource limits allow you to set boundaries (max/min & default) for the compute resources a developer can define on pod/container level (see https://docs.openshift.com/enterprise/3.1/dev_guide/compute_resources.html).

  1. Login to OpenShift with an admin user
  2. Change to target project with
oc project <my-project>
  1. Import limit range (see https://docs.openshift.com/enterprise/3.1/dev_guide/limits.html on what options are available)
oc create -f limit-range.json
  1. Browse to OpenShift admin console, select the project and then “Settings”.

B. Quotas

A quota allows you to set hard limits on the overall resource consumption on project level. This is in particular useful to create a t-shirt size based accounting model (small, medium, large) for OpenShift. See also https://docs.openshift.com/enterprise/3.1/dev_guide/quota.html.

  1. Login to OpenShift with an admin user
  2. Change to target project with
oc project <my-project>
  1. Create quota for project:
oc create -f resource-quota.json
  1. Browse to OpenShift admin console, select the project and then “Settings”.

The source code can be found on my Github page: https://github.com/sebastianfaulhaber/openshift-v3-showcase/tree/master/openshift-resources