Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1640648

Summary: Quota not applied to project
Product: OpenShift Container Platform Reporter: Arnab Ghosh <arghosh>
Component: TemplatesAssignee: Gabe Montero <gmontero>
Status: CLOSED NOTABUG QA Contact: XiuJuan Wang <xiuwang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.9.0CC: adam.kaplan, aos-bugs, arghosh, bparees, gmontero, jokerman, mmccomas, snalawad
Target Milestone: ---   
Target Release: 3.9.z   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-01 17:38:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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

Comment 12 Red Hat Bugzilla 2023-09-15 00:13:01 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days