Bug 1640648 - Quota not applied to project [NEEDINFO]
Summary: Quota not applied to project
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Templates
Version: 3.9.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 3.9.z
Assignee: Gabe Montero
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-18 13:49 UTC by Arnab Ghosh
Modified: 2022-03-13 15:48 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-01 17:38:08 UTC
Target Upstream Version:
Embargoed:
gmontero: needinfo? (arghosh)


Attachments (Terms of Use)

Description Arnab Ghosh 2018-10-18 13:49:17 UTC
Description of problem:
Description of quota does not show any value when template is deployed using REST API call.
~~~
[root@master-0 ~]# oc get quota
NAME                 AGE
compute-resources    56m
platform-resources   56m
~~~

~~~
[root@master-0 ~]# oc describe quota
Name:       compute-resources
Namespace:  exampleproj2
Resource    Used  Hard
--------    ----  ----


Name:       platform-resources
Namespace:  exampleproj2
Resource    Used  Hard
--------    ----  ----
~~~

Version-Release number of selected component (if applicable):
- Openshift Container Platform 3.9

How reproducible:
Reproducible

Steps to Reproduce:
1. Create a template which will create a project and apply ResourceQuota
2. Create a secret to provide value of environment variable while templateinstance creation
3. Create the templateinstance using REST API call.

Actual results:

~~~
Name:       compute-resources
Namespace:  new
Resource    Used  Hard
--------    ----  ----

Name:       platform-resources
Namespace:  new
Resource    Used  Hard
--------    ----  ----
~~~

Expected results:

~~~
Name:       compute-resources
Namespace:  new
Resource       Used  Hard
--------       ----  ----
limits.memory  0     1Gi
requests.cpu   0     1

Name:       platform-resources
Namespace:  new
Resource                Used  Hard
--------                ----  ----
pods                    0     30
persistentvolumeclaims  0     10
requests.storage        0     500Gi
~~~
Additional info:

Comment 2 Ben Parees 2018-10-18 14:14:09 UTC
4 questions:

1) Does the template instance claim to have applied successfully?  (retrieve the templateinstance after you've created it and examine it, it should report some status).

2) are any of the other objects from the template (e.g. the rolebindings) being created?

3) Are you able to successfully instantiate other objects from a template instance using this workflow?  (e.g. a template that just creates a pod or something else)

4) Are you able to directly create these quota objects using the same token?

Comment 3 Arnab Ghosh 2018-10-18 14:36:27 UTC
Hi Ben,

Please find my answers below.

Ben> Does the template instance claim to have applied successfully?
Arnab> Yes
~~~
status:
  conditions:
  - lastTransitionTime: 2018-10-18T14:29:47Z
    message: ""
    reason: Created
    status: "True"
    type: Ready
~~~

Ben> are any of the other objects from the template (e.g. the rolebindings) being created?
Arnab> Yes
~~~
[root@master-0 ~]# oc describe limits
Name:       compute-limits
Namespace:  exampleproj2
Type        Resource  Min    Max   Default Request  Default Limit  Max Limit/Request Ratio
----        --------  ---    ---   ---------------  -------------  -----------------------
Pod         cpu       7m     2     -                -              -
Pod         memory    100Mi  16Gi  -                -              -
Container   cpu       7m     2     50m              500m           -
Container   memory    100Mi  16Gi  128Mi            256Mi          -
[root@master-0 ~]# oc get rolebindings
NAME                    ROLE                    USERS     GROUPS                                SERVICE ACCOUNTS   SUBJECTS
admins                  /admin                  tin2933                                                            
system:deployers        /system:deployer                                                        deployer           
system:image-builders   /system:image-builder                                                   builder            
system:image-pullers    /system:image-puller              system:serviceaccounts:exampleproj2                 
~~~

Ben> Are you able to successfully instantiate other objects from a template instance using this workflow?
Arnab> Yes, was able to create a POD using this workflow.

Ben> Are you able to directly create these quota objects using the same token?
Arnab> Yes, I could create quota using 'oc create -f' command keeping definition same as in the template 

Regards
Arnab

Comment 4 Ben Parees 2018-10-18 15:22:04 UTC
Corey: Sounds like the templateinstance controller is silently consuming an error message when creating an object.  That would be unusual but it should be easy to recreate+add logging for to see what's going on.

Comment 6 Corey Daley 2018-11-14 19:02:47 UTC
No updates yet but it is next on my list


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