Bug 1730719 - Build Defaults not being applied to pods
Summary: Build Defaults not being applied to pods
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 4.1.z
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.2.0
Assignee: Ricardo Maraschini
QA Contact: wewang
URL:
Whiteboard:
Depends On:
Blocks: 1735709
TreeView+ depends on / blocked
 
Reported: 2019-07-17 12:51 UTC by Wolfgang Kulhanek
Modified: 2020-02-21 10:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1735709 (view as bug list)
Environment:
Last Closed: 2019-10-16 06:29:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-openshift-controller-manager-operator pull 109 0 'None' closed Bug 1730719: Respecting resource limits and requests during build. 2020-03-17 07:26:59 UTC
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:32:03 UTC

Description Wolfgang Kulhanek 2019-07-17 12:51:42 UTC
Description of problem:
Setting Build Defaults (requests/limits) has no effect on actual build pod.


Version-Release number of selected component (if applicable):
4.1.4

How reproducible:
Always

Steps to Reproduce:
1. Set up Build Defaults
oc describe build.config.openshift.io/cluster
Name:         cluster
Namespace:
Labels:       <none>
Annotations:  release.openshift.io/create-only: true
API Version:  config.openshift.io/v1
Kind:         Build
Metadata:
  Creation Timestamp:  2019-07-14T14:51:04Z
  Generation:          4
  Resource Version:    570536
  Self Link:           /apis/config.openshift.io/v1/builds/cluster
  UID:                 cdbbd18d-a646-11e9-a64f-0206c3a2392c
Spec:
  Build Defaults:
    Resources:
      Limits:
        Cpu:     1
        Memory:  3Gi
      Requests:
        Cpu:     1
        Memory:  2Gi
Events:          <none>


2. Set up a LimitRange (in a Project Request Template) and create a new project
oc describe limits  wk-builds-core-resource-limits
Name:       wk-builds-core-resource-limits
Namespace:  wk-builds
Type        Resource  Min  Max   Default Request  Default Limit  Max Limit/Request Ratio
----        --------  ---  ---   ---------------  -------------  -----------------------
Container   memory    6Mi  6Gi   512Mi            1Gi            -
Container   cpu       -    -     250m             500m           -
Pod         memory    6Mi  12Gi  -                -              -

2. Start a new build
oc new-app https://github.com/wkulhanek/rhte-app.git

3. Check the build pod
oc describe pod rhte-app-1-build

[...]
    Limits:
      cpu:     500m
      memory:  1Gi
    Requests:
      cpu:     250m
      memory:  512Mi
[...]

Actual results:
The pod uses the defaults from the Limit Range rather than the build defaults.


Expected results:
The pod uses the defaults from the build defaults therefore not needing to fall back on the defaults from the limit range

Comment 1 Adam Kaplan 2019-07-17 13:00:20 UTC
Marking this as a regression from 3.11, blocker for 4.2.0

Comment 2 wewang 2019-07-18 06:29:04 UTC
FYI, @Wolfgang Kulhanek  your Build Default config incorrect, should be 
Spec:
  buildDefaults:
    Resources:

Comment 3 Wolfgang Kulhanek 2019-07-18 12:58:51 UTC
@wewang My build defaults are straight from the docs:
https://docs.openshift.com/container-platform/4.1/builds/build-configuration.html

This is exactly what I have:

apiVersion: config.openshift.io/v1
kind: Build
metadata:
  annotations:
    release.openshift.io/create-only: "true"
  creationTimestamp: "2019-07-14T14:51:04Z"
  generation: 4
  name: cluster
  resourceVersion: "570536"
  selfLink: /apis/config.openshift.io/v1/builds/cluster
  uid: cdbbd18d-a646-11e9-a64f-0206c3a2392c
spec:
  buildDefaults:
    resources:
      limits:
        cpu: 1
        memory: 3Gi
      requests:
        cpu: 1
        memory: 2Gi

I don't see a difference to what you are writing. The only difference I see is "Resources" in your example vs "resources" in mine and the docs.

Comment 4 Wolfgang Kulhanek 2019-07-18 12:59:36 UTC
Oh I see. I submitted the "oc describe" and you gave me YAML. So the YAML should be fine.

Comment 11 Wolfgang Kulhanek 2019-08-02 13:59:24 UTC
@Ricardo: I keep getting notification that info is needed from me - but I don't see what. Do you actually need something from me?

Comment 13 wewang 2019-08-08 09:44:00 UTC
@Ricardo Maraschini After waiting ds rollout, config applied to build pod, thanks
version:
4.2.0-0.nightly-2019-08-07-214151

$oc describe pod/ruby-hello-world-1-build
    Limits:
      cpu:     500m
      memory:  1Gi
    Requests:
      cpu:     250m
      memory:  1Gi

Comment 14 errata-xmlrpc 2019-10-16 06:29:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2922


Note You need to log in before you can comment on or make changes to this bug.