diff options
Diffstat (limited to 'roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json')
-rw-r--r-- | roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json | 59 |
1 files changed, 43 insertions, 16 deletions
diff --git a/roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json index 68438b538..227c8d30e 100644 --- a/roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json +++ b/roles/openshift_examples/files/examples/v1.1/db-templates/mongodb-ephemeral-template.json @@ -48,8 +48,7 @@ }, "spec": { "strategy": { - "type": "Recreate", - "resources": {} + "type": "Recreate" }, "triggers": [ { @@ -62,7 +61,7 @@ "from": { "kind": "ImageStreamTag", "name": "mongodb:latest", - "namespace": "openshift" + "namespace": "${NAMESPACE}" }, "lastTriggeredImage": "" } @@ -87,19 +86,26 @@ { "name": "mongodb", "image": "mongodb", - "readinessProbe": { - "tcpSocket":{ - "port": 27017 - }, - "initialDelaySeconds": 15, - "timeoutSeconds": 1 - }, "ports": [ { "containerPort": 27017, "protocol": "TCP" } ], + "readinessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 3, + "exec": { + "command": [ "/bin/sh", "-i", "-c", "mongostat --host 127.0.0.1 -u admin -p $MONGODB_ADMIN_PASSWORD -n 1 --noheaders"] + } + }, + "livenessProbe": { + "timeoutSeconds": 1, + "initialDelaySeconds": 30, + "tcpSocket": { + "port": 27017 + } + }, "env": [ { "name": "MONGODB_USER", @@ -118,7 +124,11 @@ "value": "${MONGODB_ADMIN_PASSWORD}" } ], - "resources": {}, + "resources": { + "limits": { + "memory": "${MEMORY_LIMIT}" + } + }, "volumeMounts": [ { "name": "${DATABASE_SERVICE_NAME}-data", @@ -152,34 +162,51 @@ ], "parameters": [ { + "name": "MEMORY_LIMIT", + "displayName": "Memory Limit", + "description": "Maximum amount of memory the container can use.", + "value": "512Mi" + }, + { + "name": "NAMESPACE", + "displayName": "Namespace", + "description": "The OpenShift Namespace where the ImageStream resides.", + "value": "openshift" + }, + { "name": "DATABASE_SERVICE_NAME", - "description": "Database service name", + "displayName": "Database Service Name", + "description": "The name of the OpenShift Service exposed for the database.", "value": "mongodb", "required": true }, { "name": "MONGODB_USER", - "description": "Username for MongoDB user that will be used for accessing the database", + "displayName": "MongoDB User", + "description": "Username for MongoDB user that will be used for accessing the database.", "generate": "expression", "from": "user[A-Z0-9]{3}", "required": true }, { "name": "MONGODB_PASSWORD", - "description": "Password for the MongoDB user", + "displayName": "MongoDB Password", + "description": "Password for the MongoDB user.", "generate": "expression", "from": "[a-zA-Z0-9]{16}", "required": true }, { "name": "MONGODB_DATABASE", - "description": "Database name", + "displayName": "MongoDB Database Name", + "description": "Name of the MongoDB database accessed.", "value": "sampledb", "required": true }, { "name": "MONGODB_ADMIN_PASSWORD", - "description": "Password for the database admin user", + "displayName": "MongoDB Admin Password", + "description": "Password for the database admin user.", "generate": "expression", "from": "[a-zA-Z0-9]{16}", "required": true |