[OpenShift] – Resources configuration of a pod

The request resources is a configuration related to the quantity of memory and CPU minimal required to run the pod on a node. It is used for the OpenShift select available nodes to create the pods when it is escalated to many nodes for example.

The limits are related to the values used for the application itself. If the application tries to use more than the limit defined for memory it will die with an out of memory issue for example. The number of CPUs defined will be the quantity available to be used for the pod, in this way, if the quantity is too small for the process it will be very slow.

Following an example to update the resources of a pod/application.

  • Memory limit: 3Gi
  • Memory request: 2Gi
  • CPU request: 1 CPU
  • CPU limit: 2 CPUs

$oc set resources dc/myapp --limits=memory=3Gi,cpu=2 --requests=memory=2Gi,cpu=1

Note that this configuration is set up in the deploy config.

$oc edit dc/myapp

Screen Shot 2018-04-18 at 10.29.56

In the console, this information will be available in the deploy of the application as follows.

Screen Shot 2018-04-18 at 10.45.34




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s