{ "kind": "Template", "apiVersion": "v1", "metadata": { "name": "ruby-helloworld-is-dc-limit", "creationTimestamp": null, "annotations": { "description": "This example shows how to create a simple ruby application in openshift origin v3", "iconClass": "icon-ruby", "tags": "instant-app,ruby,mysql" } }, "objects": [ { "kind": "ImageStream", "apiVersion": "v1", "metadata": { "name": "origin-ruby-sample", "creationTimestamp": null }, "spec": {}, "status": { "dockerImageRepository": "" } }, { "kind": "ImageStream", "apiVersion": "v1", "metadata": { "name": "ruby-20-centos7", "creationTimestamp": null }, "spec": { "dockerImageRepository": "openshift/ruby-20-centos7" }, "status": { "dockerImageRepository": "" } }, { "kind": "DeploymentConfig", "apiVersion": "v1", "metadata": { "name": "frontend", "namespace": "test", "creationTimestamp": "2015-05-01T20:22:22Z", "labels": { "template": "application-template-isdc" } }, "spec": { "strategy": { "type": "Recreate", "recreateParams": { "pre": { "failurePolicy": "Abort", "execNewPod": { "command": [ "/bin/true" ], "env": [ { "name": "CUSTOM_VAR1", "value": "custom_value1" } ], "containerName": "ruby-helloworld" } }, "post": { "failurePolicy": "Ignore", "execNewPod": { "command": [ "/bin/false" ], "env": [ { "name": "CUSTOM_VAR2", "value": "custom_value2" } ], "containerName": "ruby-helloworld" } } }, "resources": { "limits": { "cpu": "${DEPLOY_FRONTEND_RESOURCES_LIMITS_CPU}", "memory": "${DEPLOY_FRONTEND_RESOURCES_LIMITS_MEMORY}" } } }, "triggers": [ { "type": "ImageChange", "imageChangeParams": { "automatic": true, "containerNames": [ "ruby-helloworld" ], "from": { "kind": "ImageStreamTag", "name": "origin-ruby-sample:latest" }, "lastTriggeredImage": "" } } ], "replicas": 1, "selector": { "name": "frontend" }, "template": { "metadata": { "creationTimestamp": null, "labels": { "name": "frontend" } }, "spec": { "containers": [ { "name": "ruby-helloworld", "image": "origin-ruby-sample", "ports": [ { "containerPort": 8080, "protocol": "TCP" } ], "env": [ { "name": "ADMIN_USERNAME", "value": "${ADMIN_USERNAME}" }, { "name": "ADMIN_PASSWORD", "value": "${ADMIN_PASSWORD}" }, { "name": "MYSQL_USER", "value": "${MYSQL_USER}" }, { "name": "MYSQL_PASSWORD", "value": "${MYSQL_PASSWORD}" }, { "name": "MYSQL_DATABASE", "value": "${MYSQL_DATABASE}" } ], "resources": { "limits": { "cpu": "${FRONTEND_RESOURCES_LIMITS_CPU}", "memory": "${FRONTEND_RESOURCES_LIMITS_MEMORY}" } }, "terminationMessagePath": "/dev/termination-log", "imagePullPolicy": "IfNotPresent", "capabilities": {}, "securityContext": { "capabilities": {}, "privileged": false } } ], "restartPolicy": "Always", "dnsPolicy": "ClusterFirst" } } }, "status": {} }, { "kind": "DeploymentConfig", "apiVersion": "v1", "metadata": { "name": "database", "namespace": "test", "creationTimestamp": "2015-05-01T20:22:22Z", "labels": { "template": "application-template-isdc" } }, "spec": { "strategy": { "type": "Recreate", "resources": { "limits": { "cpu": "${DEPLOY_MYSQL_RESOURCES_LIMITS_CPU}", "memory": "${DEPLOY_MYSQL_RESOURCES_LIMITS_MEMORY}" } } }, "triggers": [ { "type": "ConfigChange" } ], "replicas": 1, "selector": { "name": "database" }, "template": { "metadata": { "creationTimestamp": null, "labels": { "name": "database" } }, "spec": { "containers": [ { "name": "ruby-helloworld-database", "image": "openshift/mysql-55-centos7", "ports": [ { "containerPort": 3306, "protocol": "TCP" } ], "env": [ { "name": "MYSQL_USER", "value": "${MYSQL_USER}" }, { "name": "MYSQL_PASSWORD", "value": "${MYSQL_PASSWORD}" }, { "name": "MYSQL_DATABASE", "value": "${MYSQL_DATABASE}" } ], "resources": { "limits": { "cpu": "${MYSQL_RESOURCES_LIMITS_CPU}", "memory": "${MYSQL_RESOURCES_LIMITS_MEMORY}" } }, "terminationMessagePath": "/dev/termination-log", "imagePullPolicy": "IfNotPresent", "capabilities": {}, "securityContext": { "capabilities": {}, "privileged": false } } ], "restartPolicy": "Always", "dnsPolicy": "ClusterFirst" } } }, "status": { "latestVersion": 1, "details": { "causes": [ { "type": "ConfigChange" } ] } } } ], "parameters": [ { "name": "ADMIN_USERNAME", "description": "administrator username", "generate": "expression", "from": "admin[A-Z0-9]{3}" }, { "name": "ADMIN_PASSWORD", "description": "administrator password", "generate": "expression", "from": "[a-zA-Z0-9]{8}" }, { "name": "MYSQL_USER", "description": "database username", "generate": "expression", "from": "user[A-Z0-9]{3}" }, { "name": "MYSQL_PASSWORD", "description": "database password", "generate": "expression", "from": "[a-zA-Z0-9]{8}" }, { "name": "MYSQL_DATABASE", "description": "database name", "value": "root" }, { "name": "MYSQL_RESOURCES_LIMITS_MEMORY", "description": "database memory limit", "value": "200Mi" }, { "name": "MYSQL_RESOURCES_LIMITS_CPU", "description": "database cpu limit", "value": "400m" }, { "name": "DEPLOY_MYSQL_RESOURCES_LIMITS_MEMORY", "description": "deploy database memory limit", "value": "50Mi" }, { "name": "DEPLOY_MYSQL_RESOURCES_LIMITS_CPU", "description": "deploy database cpu limit", "value": "20m" }, { "name": "FRONTEND_RESOURCES_LIMITS_MEMORY", "description": "frontend memory limit", "value": "100Mi" }, { "name": "FRONTEND_RESOURCES_LIMITS_CPU", "description": "frontend cpu limit", "value": "200m" }, { "name": "DEPLOY_FRONTEND_RESOURCES_LIMITS_MEMORY", "description": "deploy frontend memory limit", "value": "50Mi" }, { "name": "DEPLOY_FRONTEND_RESOURCES_LIMITS_CPU", "description": "deploy frontend cpu limit", "value": "20m" } ], "labels": { "template": "application-template-isdc" } }