How to configure limits and requests of memory and CPU in OSD/ROSA?

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Service on AWS (ROSA)
    • 4
  • Red Hat OpenShift Dedicated (OSD)
    • 4

Issue

  • Deployment failing while installing operators like the group-sync-operator and grafana-operator.
  • How to configure limits and requests of memory and CPU?
  • Cluster advisor suggested to set the CPU/memory resource requests and limits to deployments while installing operators.

Resolution

To set/specify the resource requests and limits for a deployment, run the following command:

$ oc set resources deployment <deployment_name> --requests cpu=<value>,memory=<value> --limits cpu=<value>,memory=<value>

Root Cause

The cpu or memory requests and limits of some opeartors are un-defined by default. When trying to deploy those operators into a namespace, the operator deployment fails.

Diagnostic Steps

Check the namespace quotas in the namespace where the pods are failing:

$ oc get resourcequotas -n [namespace_name]

To estimate what cpu and memory resources has been assigned by default to pods:

$ oc adm top pods -n [namespace_name]

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments