summaryrefslogtreecommitdiffstats
path: root/roles/openshift_examples/files/examples/v1.3/quickstart-templates/nodejs-mongodb.json
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_examples/files/examples/v1.3/quickstart-templates/nodejs-mongodb.json')
-rw-r--r--roles/openshift_examples/files/examples/v1.3/quickstart-templates/nodejs-mongodb.json100
1 files changed, 75 insertions, 25 deletions
diff --git a/roles/openshift_examples/files/examples/v1.3/quickstart-templates/nodejs-mongodb.json b/roles/openshift_examples/files/examples/v1.3/quickstart-templates/nodejs-mongodb.json
index 6ab4a1781..91f9ec7b3 100644
--- a/roles/openshift_examples/files/examples/v1.3/quickstart-templates/nodejs-mongodb.json
+++ b/roles/openshift_examples/files/examples/v1.3/quickstart-templates/nodejs-mongodb.json
@@ -4,22 +4,37 @@
"metadata": {
"name": "nodejs-mongodb-example",
"annotations": {
- "description": "An example Node.js application with a MongoDB database",
- "tags": "quickstart,nodejs,mongodb",
+ "openshift.io/display-name": "Node.js + MongoDB (Ephemeral)",
+ "description": "An example Node.js application with a MongoDB database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/nodejs-ex/blob/master/README.md.\n\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing.",
+ "tags": "quickstart,nodejs",
"iconClass": "icon-nodejs"
}
},
+ "message": "The following service(s) have been created in your project: ${NAME}, ${DATABASE_SERVICE_NAME}.\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/openshift/nodejs-ex/blob/master/README.md.",
"labels": {
"template": "nodejs-mongodb-example"
},
"objects": [
{
+ "kind": "Secret",
+ "apiVersion": "v1",
+ "metadata": {
+ "name": "${NAME}"
+ },
+ "stringData": {
+ "databaseUser": "${DATABASE_USER}",
+ "databasePassword": "${DATABASE_PASSWORD}",
+ "databaseAdminPassword" : "${DATABASE_ADMIN_PASSWORD}"
+ }
+ },
+ {
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "${NAME}",
"annotations": {
- "description": "Exposes and load balances the application pods"
+ "description": "Exposes and load balances the application pods",
+ "service.alpha.openshift.io/dependencies": "[{\"name\": \"${DATABASE_SERVICE_NAME}\", \"kind\": \"Service\"}]"
}
},
"spec": {
@@ -85,10 +100,10 @@
"namespace": "${NAMESPACE}",
"name": "nodejs:4"
},
- "env": [
+ "env": [
{
- "name": "NPM_MIRROR",
- "value": "${NPM_MIRROR}"
+ "name": "NPM_MIRROR",
+ "value": "${NPM_MIRROR}"
}
]
}
@@ -183,11 +198,21 @@
},
{
"name": "MONGODB_USER",
- "value": "${DATABASE_USER}"
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "databaseUser"
+ }
+ }
},
{
"name": "MONGODB_PASSWORD",
- "value": "${DATABASE_PASSWORD}"
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "databasePassword"
+ }
+ }
},
{
"name": "MONGODB_DATABASE",
@@ -195,7 +220,12 @@
},
{
"name": "MONGODB_ADMIN_PASSWORD",
- "value": "${DATABASE_ADMIN_PASSWORD}"
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "databaseAdminPassword"
+ }
+ }
}
],
"readinessProbe": {
@@ -207,17 +237,17 @@
}
},
"livenessProbe": {
- "timeoutSeconds": 3,
- "initialDelaySeconds": 30,
- "httpGet": {
- "path": "/pagecount",
- "port": 8080
- }
+ "timeoutSeconds": 3,
+ "initialDelaySeconds": 30,
+ "httpGet": {
+ "path": "/pagecount",
+ "port": 8080
+ }
},
"resources": {
- "limits": {
- "memory": "${MEMORY_LIMIT}"
- }
+ "limits": {
+ "memory": "${MEMORY_LIMIT}"
+ }
}
}
]
@@ -303,11 +333,21 @@
"env": [
{
"name": "MONGODB_USER",
- "value": "${DATABASE_USER}"
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "databaseUser"
+ }
+ }
},
{
"name": "MONGODB_PASSWORD",
- "value": "${DATABASE_PASSWORD}"
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "databasePassword"
+ }
+ }
},
{
"name": "MONGODB_DATABASE",
@@ -315,14 +355,24 @@
},
{
"name": "MONGODB_ADMIN_PASSWORD",
- "value": "${DATABASE_ADMIN_PASSWORD}"
+ "valueFrom": {
+ "secretKeyRef" : {
+ "name" : "${NAME}",
+ "key" : "databaseAdminPassword"
+ }
+ }
}
],
"readinessProbe": {
"timeoutSeconds": 1,
"initialDelaySeconds": 3,
"exec": {
- "command": [ "/bin/sh", "-i", "-c", "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""]
+ "command": [
+ "/bin/sh",
+ "-i",
+ "-c",
+ "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""
+ ]
}
},
"livenessProbe": {
@@ -333,9 +383,9 @@
}
},
"resources": {
- "limits": {
- "memory": "${MEMORY_MONGODB_LIMIT}"
- }
+ "limits": {
+ "memory": "${MEMORY_MONGODB_LIMIT}"
+ }
},
"volumeMounts": [
{