Bug 1336359

Summary: [dev-preview-stg] ClusterResourceOverride is wrongly configured in master-config file
Product: OpenShift Online Reporter: Bing Li <bingli>
Component: WebsiteAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED CURRENTRELEASE QA Contact: Yanping Zhang <yanpzhan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, dakini, jokerman, mmccomas, tiwillia, wmeng, wsun
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-06-23 17:31:45 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:
Bug Depends On:    
Bug Blocks: 1303130    

Description Bing Li 2016-05-16 09:17:37 UTC
Description of problem:
Compute resources of containers cannot be calculated as the master configured ratio, because ClusterResourceOverride is not set correctly in master-config file,

Version-Release number of selected component (if applicable):
dev-preview-stg
openshift v3.2.0.44
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5

How reproducible:
Alwaysdev-preview-stg

Steps to Reproduce:
1. Check the master-config.yaml file in dev-preview-stg env, then check the ClusterResourceOverride

Actual results:
<------snip------->
kubernetesMasterConfig:
  admissionConfig:
    pluginConfig:
      ClusterResourceConfig:
        configuration:
          apiVersion: v1
          cpuRequestToLimitPercent: '6'
          kind: ClusterResourceOverrideConfig
          limitCPUToMemoryPercent: '200'
          memoryRequestToLimitPercent: '60'
<------snip------->


Expected results:
ClusterResourceOverride in master-config.yaml should be set like below:

<------snip------->
kubernetesMasterConfig:
  admissionConfig:
    pluginConfig:
      ClusterResourceOverride:
        configuration:
          apiVersion: v1
          kind: ClusterResourceOverrideConfig
          limitCPUToMemoryPercent: 200
          cpuRequestToLimitPercent: 6
          memoryRequestToLimitPercent: 60
<------snip------->

Comment 1 Abhishek Gupta 2016-05-16 17:01:28 UTC
This seems to be just about specifying the values as numbers rather than as strings - we probably just need to skip the quotes around the numeric values.

Comment 2 Abhishek Gupta 2016-05-16 17:46:15 UTC
Also, the name of the plugin in the actual configuration on master (STG) is ClusterResourceConfig, whereas based on the expectation (as per QE) it should be ClusterResourceOverride.

Comment 5 Bing Li 2016-05-17 02:47:02 UTC
Create a pod with resources like below: 
    resources:
      limits:
        memory: "600Mi"
        cpu: "400m"
      requests:
        memory: "100Mi"
        cpu: "300m"

Then the memory/cpu requests/limits of the pod will be calculated based on the override ratio:
# oc describe pod pod-limit-memory

    Limits:
      cpu:	1170m
      memory:	600Mi
    Requests:
      cpu:		70m
      memory:		360Mi

Move to verified.