Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-5976

Errors when applying ResourceQuota and LimitRanges to workspaces

XMLWordPrintable

    • False
    • None
    • False

      Description of problem:

      This is my customers issue:
      I want to control the quota for devspaces user at global level, as of now there is no quota set for a user.
      How I can set a quota at global level so that a particular user should not consume all the system resources by defining resources in devfile.
      Note: Quota should be at user namespace level controlled by cluster-admin, not at cluster level because it will not solving my purpose.
      Please can you review the reproducer below, and advise on the best way to implement CPU and memory controls in workspaces?

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      1. Provision ROSA cluster
      2. Install devspaces
      3. create a cheserver
      4. Apply the following RQ to the devspaces workspace namespace:

       

      $ cat resource-quota.yaml
      apiVersion: v1
      kind: ResourceQuota
      metadata:
        name: andbartl-quota
      spec:
        hard:
          limits.cpu: "4"
          limits.memory: 5Gi
          persistentvolumeclaims: "4"
          requests.cpu: 3900m
          requests.memory: 4800Mi
          requests.storage: 30Gi
      
      $ oc create -f resource-quota.yaml -n cluster-admin-devspaces 

      Now try and add an empty workspace and the following error occurs:

      Failed to open the workspace

      Error creating DevWorkspace deployment: Detected unrecoverable deployment condition: FailedCreate pods "workspace78e4bff00eea46fb-78db984f76-mkvcn" is forbidden: failed quota: andbartl-quota: must specify limits.cpu for: che-gateway,universal-developer-image; requests.cpu for: universal-developer-image

       

      If I try the same workspace creation with a devfile:

       

      schemaVersion: 2.1.0
      metadata:
        name: multi-container-test
      components:      
        - name: tools
          container:
            image: registry.redhat.io/devspaces/udi-rhel8@sha256:b0dfd9e15d878785bea5cb33a82a014abbd08c839917e72a8cd629c84bf47f1e
            cpuLimit: 750m
            cpuRequest: 450m
            memoryLimit: 512M
            memoryRequest: 256M
        - name: dixital
          container:
            image: registry.redhat.io/devspaces/udi-rhel8@sha256:b0dfd9e15d878785bea5cb33a82a014abbd08c839917e72a8cd629c84bf47f1e
            cpuLimit: 750m
            cpuRequest: 450m
            memoryLimit: 512M
            memoryRequest: 256M 

      and create using my github, I get the following error:

      Failed to open the workspace

      Error creating DevWorkspace deployment: Detected unrecoverable deployment condition: FailedCreate pods "workspace6b8d5750d44348ce-547969cd78-7dndf" is forbidden: failed quota: andbartl-quota: must specify limits.cpu for: che-gateway

       

       

      Actual results:

      Expected results:

      Reproducibility (Always/Intermittent/Only Once):

      Acceptance criteria: 

       

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

       

       *

            ibuziuk@redhat.com Ilya Buziuk
            rhn-support-andbartl Andy Bartlett
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: