Bug 1312282

Summary: Request/Limit of individual container shouldn't exceed to the pod
Product: OKD Reporter: Qixuan Wang <qixuan.wang>
Component: PodAssignee: Derek Carr <decarr>
Status: CLOSED WONTFIX QA Contact: DeShuai Ma <dma>
Severity: low Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-07 14:35:37 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:

Description Qixuan Wang 2016-02-26 10:31:21 UTC
Description of problem:
Set request/limit of limitType=Container larger than limitType=Pod, no warning message shows and the limitrange resource can be created.

Version-Release number of selected component (if applicable):
oc v1.1.3-274-g209837a
kubernetes v1.2.0-alpha.7-703-gbc4550d

How reproducible:
Always

Steps to Reproduce:
1.Set limitrange resource
# cat limitrange.yaml 
apiVersion: v1
kind: LimitRange
metadata:
  name: limitrange
spec:
  limits:
  - max:
      cpu: 500m
      memory: 750Mi
    min:
      cpu: 10m
      memory: 5Mi
    maxLimitRequestRatio:
      cpu: 1
      memory: 2
    type: Pod
  - default:
      cpu: 900m
      memory: 800Mi
    defaultRequest:
      cpu: 600m
      memory: 760Mi
    maxLimitRequestRatio:
      cpu: 10
      memory: 8
    max:
      cpu: 1
      memory: 4Gi
    min:
      cpu: 10m
      memory: 5Mi
    type: Container

# oc create -f limitrange.yaml -n qwang1 --config=./admin.kubeconfig

2.Check limits
# oc describe limits limitrange


Actual results:
2. # oc describe limits limitrange 
Name:		limitrange
Namespace:	qwang1
Type		Resource	Min	Max	Default Request	Default Limit	Max Limit/Request Ratio
----		--------	---	---	---------------	-------------	-----------------------
Pod		cpu		10m	500m	-		-		1
Pod		memory		5Mi	750Mi	-		-		2
Container	memory		5Mi	4Gi	760Mi		800Mi		8
Container	cpu		10m	1	600m		900m		10

Expected results:
It's better to check limitrange validity. When request/limit exceed to pod restriction, it should give warning messages.

Additional info:

Comment 1 Qixuan Wang 2016-02-26 15:58:48 UTC
*** Bug 1312385 has been marked as a duplicate of this bug. ***

Comment 2 Derek Carr 2016-02-26 16:22:38 UTC
Future support may in-fact allow a pod to be over-committed by its containers.

Comment 3 Derek Carr 2016-04-07 14:35:37 UTC
I am closing this as not a bug.

We plan to allow a pod to be overcommitted by its containers in the future when we add pod-level cgroups.