How to specify limits and requests for cpu and memory in OpenShift

Solution Verified - Updated -

Issue

  • How to specify limits.cpu, limits.memory, requests.cpu, requests.memory for builds or for any workload?
  • When applying resourcequota at project level builds fails with below error :

    Error creating: pods "test-php-1-build" is forbidden: Failed quota: ludo-quota: must specify limits.cpu,limits.memory,requests.cpu,requests.memory
    23s        23s         1         test-php-1   Build                 Warning   HandleBuildError   {build-controller }   Build has error: failed to create build pod: pods "test-php-1-build" is forbidden: Failed quota: ludo-quota: must specify limits.cpu,limits.memory,requests.cpu,requests.memory
    
  • Replicaset failed to start the Pod(s) with the condition:

    message: 'pods "httpd-5bc7bcb454-bbkj4" is forbidden: failed quota: compute-resources: must specify limits.cpu,limits.memory'
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 3
    • 4
  • CPU and memory requests and limits

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content