Bug 1336652

Summary: cakephp-mysql-example template cannot deploy successfully first time due to compute-resources-timebound quota limitation
Product: OpenShift Online Reporter: Wang Haoran <haowang>
Component: TemplatesAssignee: Dan Mace <dmace>
Status: CLOSED CURRENTRELEASE QA Contact: XiuJuan Wang <xiuwang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, dmace, jokerman, mmccomas
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-06-23 17:32:55 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 Wang Haoran 2016-05-17 07:01:44 UTC
Description of problem:
After create app using cakephp-mysql-example template , the app cannot deploy successfully, we have an timeboud quota limit the run once pod have a 1Gi mem limitation , but this template have too dc , the cakephp-mysql-example dc have an pre pod definition , which caused deploy the two dc will exceed the limitation.

Version-Release number of selected component (if applicable):
dev-preview-stg

How reproducible:
always

Steps to Reproduce:
1.create a project
2.oc new-app cakephp-mysql-example
3.check the pod status
Actual results:
[haoran@cheetah tmp.yrS7Rfscpi]$ oc get pod
NAME                             READY     STATUS              RESTARTS   AGE
cakephp-mysql-example-1-build    0/1       Completed           0          17m
cakephp-mysql-example-1-deploy   0/1       Error               0          16m

Expected results:
As a user , I want my app created successfully the first time I use openshift

Additional info:

Comment 1 Dan Mace 2016-05-17 12:55:24 UTC
I was able to reproduce this. The template defines two deploymentConfigs and one of them has a pre hook. Each timebound pod for the deployment is configured to use 512 MB. Since deployments are executed concurrently, (512 * 3)MB are required for this configuration to succeed.

I'm not sure there are any short term solutions for this beyond further tweaks to the timebound quota limits. Serial deployment execution is possible but will require work in origin.

Comment 2 Dan Mace 2016-05-17 21:47:50 UTC
Short term fix in https://github.com/openshift/online/pull/145

Comment 3 Wang Haoran 2016-05-18 01:37:56 UTC
verified , with the new quota , pods can startup successfully now.

{
    "kind": "ResourceQuota",
    "apiVersion": "v1",
    "metadata": {
        "name": "compute-resources-timebound",
        "namespace": "uptoknow",
        "selfLink": "/api/v1/namespaces/uptoknow/resourcequotas/compute-resources-timebound",
        "uid": "a99bc6f5-1c96-11e6-ae12-0ee251450653",
        "resourceVersion": "1489342",
        "creationTimestamp": "2016-05-18T01:20:09Z"
    },
    "spec": {
        "hard": {
            "limits.cpu": "3",
            "limits.memory": "1536Mi"
        },
        "scopes": [
            "Terminating"
        ]
    },
    "status": {
        "hard": {
            "limits.cpu": "3",
            "limits.memory": "1536Mi"
        },
        "used": {
            "limits.cpu": "0",
            "limits.memory": "0"
        }
    }
}