|
@@ -17,7 +17,7 @@
|
|
|
"kind": "Service",
|
|
|
"apiVersion": "v1",
|
|
|
"metadata": {
|
|
|
- "name": "cakephp-mysql-example",
|
|
|
+ "name": "${NAME}",
|
|
|
"annotations": {
|
|
|
"description": "Exposes and load balances the application pods"
|
|
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
}
|
|
|
],
|
|
|
"selector": {
|
|
|
- "name": "cakephp-mysql-example"
|
|
|
+ "name": "${NAME}"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -39,13 +39,13 @@
|
|
|
"kind": "Route",
|
|
|
"apiVersion": "v1",
|
|
|
"metadata": {
|
|
|
- "name": "cakephp-mysql-example"
|
|
|
+ "name": "${NAME}"
|
|
|
},
|
|
|
"spec": {
|
|
|
"host": "${APPLICATION_DOMAIN}",
|
|
|
"to": {
|
|
|
"kind": "Service",
|
|
|
- "name": "cakephp-mysql-example"
|
|
|
+ "name": "${NAME}"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -53,7 +53,7 @@
|
|
|
"kind": "ImageStream",
|
|
|
"apiVersion": "v1",
|
|
|
"metadata": {
|
|
|
- "name": "cakephp-mysql-example",
|
|
|
+ "name": "${NAME}",
|
|
|
"annotations": {
|
|
|
"description": "Keeps track of changes in the application image"
|
|
|
}
|
|
@@ -63,7 +63,7 @@
|
|
|
"kind": "BuildConfig",
|
|
|
"apiVersion": "v1",
|
|
|
"metadata": {
|
|
|
- "name": "cakephp-mysql-example",
|
|
|
+ "name": "${NAME}",
|
|
|
"annotations": {
|
|
|
"description": "Defines how to build the application"
|
|
|
}
|
|
@@ -90,7 +90,7 @@
|
|
|
"output": {
|
|
|
"to": {
|
|
|
"kind": "ImageStreamTag",
|
|
|
- "name": "cakephp-mysql-example:latest"
|
|
|
+ "name": "${NAME}:latest"
|
|
|
}
|
|
|
},
|
|
|
"triggers": [
|
|
@@ -113,7 +113,7 @@
|
|
|
"kind": "DeploymentConfig",
|
|
|
"apiVersion": "v1",
|
|
|
"metadata": {
|
|
|
- "name": "cakephp-mysql-example",
|
|
|
+ "name": "${NAME}",
|
|
|
"annotations": {
|
|
|
"description": "Defines how to deploy the application server"
|
|
|
}
|
|
@@ -123,7 +123,7 @@
|
|
|
"type": "Rolling",
|
|
|
"recreateParams": {
|
|
|
"pre": {
|
|
|
- "failurePolicy": "Abort",
|
|
|
+ "failurePolicy": "Retry",
|
|
|
"execNewPod": {
|
|
|
"command": [
|
|
|
"./migrate-database.sh"
|
|
@@ -143,7 +143,7 @@
|
|
|
],
|
|
|
"from": {
|
|
|
"kind": "ImageStreamTag",
|
|
|
- "name": "cakephp-mysql-example:latest"
|
|
|
+ "name": "${NAME}:latest"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -153,13 +153,13 @@
|
|
|
],
|
|
|
"replicas": 1,
|
|
|
"selector": {
|
|
|
- "name": "cakephp-mysql-example"
|
|
|
+ "name": "${NAME}"
|
|
|
},
|
|
|
"template": {
|
|
|
"metadata": {
|
|
|
- "name": "cakephp-mysql-example",
|
|
|
+ "name": "${NAME}",
|
|
|
"labels": {
|
|
|
- "name": "cakephp-mysql-example"
|
|
|
+ "name": "${NAME}"
|
|
|
}
|
|
|
},
|
|
|
"spec": {
|
|
@@ -172,6 +172,22 @@
|
|
|
"containerPort": 8080
|
|
|
}
|
|
|
],
|
|
|
+ "readinessProbe": {
|
|
|
+ "timeoutSeconds": 3,
|
|
|
+ "initialDelaySeconds": 3,
|
|
|
+ "httpGet": {
|
|
|
+ "path": "/health.php",
|
|
|
+ "port": 8080
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "livenessProbe": {
|
|
|
+ "timeoutSeconds": 3,
|
|
|
+ "initialDelaySeconds": 30,
|
|
|
+ "httpGet": {
|
|
|
+ "path": "/",
|
|
|
+ "port": 8080
|
|
|
+ }
|
|
|
+ },
|
|
|
"env": [
|
|
|
{
|
|
|
"name": "DATABASE_SERVICE_NAME",
|
|
@@ -296,24 +312,38 @@
|
|
|
"containerPort": 3306
|
|
|
}
|
|
|
],
|
|
|
- "env": [
|
|
|
- {
|
|
|
- "name": "MYSQL_USER",
|
|
|
- "value": "${DATABASE_USER}"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "MYSQL_PASSWORD",
|
|
|
- "value": "${DATABASE_PASSWORD}"
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "MYSQL_DATABASE",
|
|
|
- "value": "${DATABASE_NAME}"
|
|
|
+ "readinessProbe": {
|
|
|
+ "timeoutSeconds": 1,
|
|
|
+ "initialDelaySeconds": 5,
|
|
|
+ "exec": {
|
|
|
+ "command": [ "/bin/sh", "-i", "-c", "MYSQL_PWD='${DATABASE_PASSWORD}' mysql -h 127.0.0.1 -u ${DATABASE_USER} -D ${DATABASE_NAME} -e 'SELECT 1'" ]
|
|
|
}
|
|
|
+ },
|
|
|
+ "livenessProbe": {
|
|
|
+ "timeoutSeconds": 1,
|
|
|
+ "initialDelaySeconds": 30,
|
|
|
+ "tcpSocket": {
|
|
|
+ "port": 3306
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "env": [
|
|
|
+ {
|
|
|
+ "name": "MYSQL_USER",
|
|
|
+ "value": "${DATABASE_USER}"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "MYSQL_PASSWORD",
|
|
|
+ "value": "${DATABASE_PASSWORD}"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "MYSQL_DATABASE",
|
|
|
+ "value": "${DATABASE_NAME}"
|
|
|
+ }
|
|
|
],
|
|
|
"resources": {
|
|
|
- "limits": {
|
|
|
- "memory": "${MEMORY_MYSQL_LIMIT}"
|
|
|
- }
|
|
|
+ "limits": {
|
|
|
+ "memory": "${MEMORY_MYSQL_LIMIT}"
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
]
|
|
@@ -324,101 +354,104 @@
|
|
|
],
|
|
|
"parameters": [
|
|
|
{
|
|
|
+ "name": "NAME",
|
|
|
+ "displayName": "Name",
|
|
|
+ "description": "The name assigned to all of the frontend objects defined in this template.",
|
|
|
+ "required": true,
|
|
|
+ "value": "cakephp-mysql-example"
|
|
|
+ },
|
|
|
+ {
|
|
|
"name": "MEMORY_LIMIT",
|
|
|
- "displayName": "Memory limit",
|
|
|
- "description": "Maximum amount of memory the CakePHP container can use",
|
|
|
+ "displayName": "Memory Limit",
|
|
|
+ "description": "Maximum amount of memory the CakePHP container can use.",
|
|
|
"value": "512Mi"
|
|
|
},
|
|
|
{
|
|
|
"name": "MEMORY_MYSQL_LIMIT",
|
|
|
- "displayName": "Memory limit",
|
|
|
- "description": "Maximum amount of memory the MySQL container can use",
|
|
|
+ "displayName": "Memory Limit (MySQL)",
|
|
|
+ "description": "Maximum amount of memory the MySQL container can use.",
|
|
|
"value": "512Mi"
|
|
|
},
|
|
|
{
|
|
|
"name": "SOURCE_REPOSITORY_URL",
|
|
|
- "displayName": "Source repository URL",
|
|
|
- "description": "The URL of the repository with your application source code",
|
|
|
+ "displayName": "Git Repository URL",
|
|
|
+ "description": "The URL of the repository with your application source code.",
|
|
|
"value": "https://github.com/openshift/cakephp-ex.git"
|
|
|
},
|
|
|
{
|
|
|
"name": "SOURCE_REPOSITORY_REF",
|
|
|
- "displayName": "Source repository reference",
|
|
|
- "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch"
|
|
|
+ "displayName": "Git Reference",
|
|
|
+ "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
|
|
|
},
|
|
|
{
|
|
|
"name": "CONTEXT_DIR",
|
|
|
- "displayName": "Context directory",
|
|
|
- "description": "Set this to the relative path to your project if it is not in the root of your repository"
|
|
|
+ "displayName": "Context Directory",
|
|
|
+ "description": "Set this to the relative path to your project if it is not in the root of your repository."
|
|
|
},
|
|
|
{
|
|
|
"name": "APPLICATION_DOMAIN",
|
|
|
- "displayName": "Application domain",
|
|
|
+ "displayName": "Application Hostname",
|
|
|
"description": "The exposed hostname that will route to the CakePHP service, if left blank a value will be defaulted.",
|
|
|
"value": ""
|
|
|
},
|
|
|
{
|
|
|
"name": "GITHUB_WEBHOOK_SECRET",
|
|
|
- "displayName": "GitHub webhook secret",
|
|
|
- "description": "A secret string used to configure the GitHub webhook",
|
|
|
+ "displayName": "GitHub Webhook Secret",
|
|
|
+ "description": "A secret string used to configure the GitHub webhook.",
|
|
|
"generate": "expression",
|
|
|
"from": "[a-zA-Z0-9]{40}"
|
|
|
},
|
|
|
{
|
|
|
"name": "DATABASE_SERVICE_NAME",
|
|
|
- "displayName": "Database service name",
|
|
|
- "description": "Database service name",
|
|
|
+ "displayName": "Database Service Name",
|
|
|
"value": "mysql"
|
|
|
},
|
|
|
{
|
|
|
"name": "DATABASE_ENGINE",
|
|
|
- "displayName": "Database engine",
|
|
|
- "description": "Database engine: postgresql, mysql or sqlite (default)",
|
|
|
+ "displayName": "Database Engine",
|
|
|
+ "description": "Database engine: postgresql, mysql or sqlite (default).",
|
|
|
"value": "mysql"
|
|
|
},
|
|
|
{
|
|
|
"name": "DATABASE_NAME",
|
|
|
- "displayName": "Database name",
|
|
|
- "description": "Database name",
|
|
|
+ "displayName": "Database Name",
|
|
|
"value": "default"
|
|
|
},
|
|
|
{
|
|
|
"name": "DATABASE_USER",
|
|
|
- "displayName": "Database user",
|
|
|
- "description": "Database user name",
|
|
|
+ "displayName": "Database User",
|
|
|
"value": "cakephp"
|
|
|
},
|
|
|
{
|
|
|
"name": "DATABASE_PASSWORD",
|
|
|
- "displayName": "Database password",
|
|
|
- "description": "Database user password",
|
|
|
+ "displayName": "Database Password",
|
|
|
"generate": "expression",
|
|
|
"from": "[a-zA-Z0-9]{16}"
|
|
|
},
|
|
|
{
|
|
|
"name": "CAKEPHP_SECRET_TOKEN",
|
|
|
"displayName": "CakePHP secret token",
|
|
|
- "description": "Set this to a long random string",
|
|
|
+ "description": "Set this to a long random string.",
|
|
|
"generate": "expression",
|
|
|
"from": "[\\w]{50}"
|
|
|
},
|
|
|
{
|
|
|
"name": "CAKEPHP_SECURITY_SALT",
|
|
|
- "displayName": "CakePHP security salt",
|
|
|
- "description": "Security salt for session hash",
|
|
|
+ "displayName": "CakePHP Security Salt",
|
|
|
+ "description": "Security salt for session hash.",
|
|
|
"generate": "expression",
|
|
|
"from": "[a-zA-Z0-9]{40}"
|
|
|
},
|
|
|
{
|
|
|
"name": "CAKEPHP_SECURITY_CIPHER_SEED",
|
|
|
- "displayName": "CakePHP security cipher seed",
|
|
|
- "description": "Security cipher seed for session hash",
|
|
|
+ "displayName": "CakePHP Security Cipher Seed",
|
|
|
+ "description": "Security cipher seed for session hash.",
|
|
|
"generate": "expression",
|
|
|
"from": "[0-9]{30}"
|
|
|
},
|
|
|
{
|
|
|
"name": "OPCACHE_REVALIDATE_FREQ",
|
|
|
- "displayName": "OPcache revalidation frequency",
|
|
|
+ "displayName": "OPcache Revalidation Frequency",
|
|
|
"description": "How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.",
|
|
|
"value": "2"
|
|
|
}
|