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

Bug 1359699

Summary: [infrastructure_public_278]Quota should properly calculate Init containers request and limits value.
Product: OpenShift Container Platform Reporter: DeShuai Ma <dma>
Component: NodeAssignee: Andy Goldstein <agoldste>
Status: CLOSED CURRENTRELEASE QA Contact: DeShuai Ma <dma>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.3.0CC: aos-bugs, ccoleman, jokerman, mmccomas, tdawson, wmeng
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-19 14:30:16 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 DeShuai Ma 2016-07-25 10:20:30 UTC
Description of problem:
When init container contain limits and request value, the quota should properly calculate init containers request and limits value for pod

Version-Release number of selected component (if applicable):
openshift v3.3.0.9
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

How reproducible:
Always

Steps to Reproduce:
1.Create quota for user project
$ oc create -f https://raw.githubusercontent.com/mdshuai/testfile-openshift/master/initContainer/quota.yaml -n $project

2.Create a pod with init container which has been set request and limits value
$ oc create -f https://raw.githubusercontent.com/mdshuai/testfile-openshift/master/initContainer/init-containers-quota-1.yaml

3.When pod is running, check pod info
$ oc describe quota compute-resources

Actual results:
[root@dhcp-128-7 dma]# oc describe quota compute-resources
Name:		compute-resources
Namespace:	dma
Resource	Used	Hard
--------	----	----
limits.cpu	300m	2
limits.memory	240Mi	2Gi
pods		1	4
requests.cpu	200m	1
requests.memory	200Mi	1Gi

Expected results:
3. The used quota = [effective init request/limit], as [effective init request/limit] > [sum of app container request/limit]

Additional info:
https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/container-init.md#resources

Comment 1 Clayton Coleman 2016-07-26 02:11:54 UTC
Fixed in https://github.com/openshift/origin/pull/10028

Comment 2 DeShuai Ma 2016-07-28 09:05:47 UTC
wait the pr to merge,then will verify this bug.

Comment 3 Weihua Meng 2016-08-04 03:15:44 UTC
Fixed.
openshift v3.3.0.14
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

# oc describe quota compute-resources
Name:		compute-resources
Namespace:	test1
Resource	Used	Hard
--------	----	----
limits.cpu	500m	2
limits.memory	400Mi	2Gi
pods		1	4
requests.cpu	400m	1
requests.memory	300Mi	1Gi