nodejs-ex/openshift/templates/nodejs-mongodb.json

392 lines
10 KiB
JSON
Raw Normal View History

2015-06-17 15:45:09 +00:00
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-mongodb-example",
"annotations": {
"description": "An example Node.js application with a MongoDB database",
2016-02-24 20:40:45 +00:00
"tags": "quickstart,nodejs,mongodb",
2015-06-17 15:45:09 +00:00
"iconClass": "icon-nodejs"
}
},
"labels": {
"template": "nodejs-mongodb-example"
},
"objects": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-mongodb-example",
2015-06-17 15:45:09 +00:00
"annotations": {
"description": "Exposes and load balances the application pods"
}
},
"spec": {
"ports": [
{
"name": "web",
"port": 8080,
"targetPort": 8080
}
],
"selector": {
"name": "nodejs-mongodb-example"
2015-06-17 15:45:09 +00:00
}
}
},
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-mongodb-example"
2015-06-17 15:45:09 +00:00
},
"spec": {
"host": "${APPLICATION_DOMAIN}",
"to": {
"kind": "Service",
"name": "nodejs-mongodb-example"
2015-06-17 15:45:09 +00:00
}
}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-mongodb-example",
2015-06-17 15:45:09 +00:00
"annotations": {
"description": "Keeps track of changes in the application image"
}
}
},
{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-mongodb-example",
2015-06-17 15:45:09 +00:00
"annotations": {
"description": "Defines how to build the application"
}
},
"spec": {
"source": {
"type": "Git",
"git": {
"uri": "${SOURCE_REPOSITORY_URL}",
"ref": "${SOURCE_REPOSITORY_REF}"
},
"contextDir": "${CONTEXT_DIR}"
},
"strategy": {
"type": "Source",
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"namespace": "openshift",
"name": "nodejs:0.10"
}
}
},
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "nodejs-mongodb-example:latest"
2015-06-17 15:45:09 +00:00
}
},
"triggers": [
{
"type": "ImageChange"
},
2015-11-20 23:24:46 +00:00
{
"type": "ConfigChange"
},
2015-06-17 15:45:09 +00:00
{
"type": "GitHub",
"github": {
"secret": "${GITHUB_WEBHOOK_SECRET}"
}
},
{
"type": "Generic",
"generic": {
"secret": "${GENERIC_WEBHOOK_SECRET}"
}
2015-06-17 15:45:09 +00:00
}
]
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-mongodb-example",
2015-06-17 15:45:09 +00:00
"annotations": {
"description": "Defines how to deploy the application server"
}
},
"spec": {
"strategy": {
"type": "Rolling"
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"nodejs-mongodb-example"
2015-06-17 15:45:09 +00:00
],
"from": {
"kind": "ImageStreamTag",
"name": "nodejs-mongodb-example:latest"
2015-06-17 15:45:09 +00:00
}
}
},
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "nodejs-mongodb-example"
2015-06-17 15:45:09 +00:00
},
"template": {
"metadata": {
"name": "nodejs-mongodb-example",
2015-06-17 15:45:09 +00:00
"labels": {
"name": "nodejs-mongodb-example"
2015-06-17 15:45:09 +00:00
}
},
"spec": {
"containers": [
{
"name": "nodejs-mongodb-example",
"image": "nodejs-mongodb-example",
2015-06-17 15:45:09 +00:00
"ports": [
{
"containerPort": 8080
}
],
"env": [
{
"name": "DATABASE_SERVICE_NAME",
"value": "${DATABASE_SERVICE_NAME}"
},
2015-06-17 15:45:09 +00:00
{
"name": "MONGODB_USER",
2015-07-31 18:18:23 +00:00
"value": "${DATABASE_USER}"
2015-06-17 15:45:09 +00:00
},
{
"name": "MONGODB_PASSWORD",
2015-07-31 18:18:23 +00:00
"value": "${DATABASE_PASSWORD}"
2015-06-17 15:45:09 +00:00
},
{
"name": "MONGODB_DATABASE",
2015-07-31 18:18:23 +00:00
"value": "${DATABASE_NAME}"
2015-06-17 15:45:09 +00:00
},
{
"name": "MONGODB_ADMIN_PASSWORD",
2015-07-31 18:18:23 +00:00
"value": "${DATABASE_ADMIN_PASSWORD}"
2015-06-17 15:45:09 +00:00
}
],
"resources": {
"limits": {
"memory": "${MEMORY_LIMIT}"
}
}
2015-06-17 15:45:09 +00:00
}
]
}
}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "${DATABASE_SERVICE_NAME}",
"annotations": {
"description": "Exposes the database server"
}
},
"spec": {
"ports": [
{
"name": "mongodb",
"port": 27017,
"targetPort": 27017
}
],
"selector": {
"name": "${DATABASE_SERVICE_NAME}"
}
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "${DATABASE_SERVICE_NAME}",
"annotations": {
"description": "Defines how to deploy the database"
}
},
"spec": {
"strategy": {
"type": "Recreate"
},
"triggers": [
2015-11-20 23:24:46 +00:00
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": false,
"containerNames": [
"mongodb"
],
"from": {
"kind": "ImageStreamTag",
2015-11-21 03:41:34 +00:00
"namespace": "openshift",
2015-11-20 23:24:46 +00:00
"name": "mongodb:2.6"
}
}
},
2015-06-17 15:45:09 +00:00
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "${DATABASE_SERVICE_NAME}"
},
"template": {
"metadata": {
"name": "${DATABASE_SERVICE_NAME}",
"labels": {
"name": "${DATABASE_SERVICE_NAME}"
}
},
"spec": {
"containers": [
{
"name": "mongodb",
2015-11-20 23:24:46 +00:00
"image": "mongodb",
2015-06-17 15:45:09 +00:00
"ports": [
{
"containerPort": 27017
}
],
"env": [
{
"name": "MONGODB_USER",
2015-07-31 18:18:23 +00:00
"value": "${DATABASE_USER}"
2015-06-17 15:45:09 +00:00
},
{
"name": "MONGODB_PASSWORD",
2015-07-31 18:18:23 +00:00
"value": "${DATABASE_PASSWORD}"
2015-06-17 15:45:09 +00:00
},
{
"name": "MONGODB_DATABASE",
2015-07-31 18:18:23 +00:00
"value": "${DATABASE_NAME}"
2015-06-17 15:45:09 +00:00
},
{
"name": "MONGODB_ADMIN_PASSWORD",
2015-07-31 18:18:23 +00:00
"value": "${DATABASE_ADMIN_PASSWORD}"
2015-06-17 15:45:09 +00:00
}
],
"resources": {
"limits": {
"memory": "${MEMORY_MONGODB_LIMIT}"
}
}
2015-06-17 15:45:09 +00:00
}
]
}
}
}
}
],
"parameters": [
{
"name": "MEMORY_LIMIT",
"displayName": "Memory limit",
"description": "Maximum amount of memory the Node.js container can use",
"value": "128Mi"
},
{
"name": "MEMORY_MONGODB_LIMIT",
"displayName": "Memory limit",
"description": "Maximum amount of memory the MongoDB container can use",
"value": "384Mi"
},
2015-06-17 15:45:09 +00:00
{
"name": "SOURCE_REPOSITORY_URL",
"displayName": "Source repository URL",
2015-06-17 15:45:09 +00:00
"description": "The URL of the repository with your application source code",
"value": "https://github.com/openshift/nodejs-ex.git"
},
{
"name": "SOURCE_REPOSITORY_REF",
"displayName": "Source repository reference",
2015-06-17 15:45:09 +00:00
"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",
2015-06-17 15:45:09 +00:00
"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 hostname",
2015-08-18 17:19:24 +00:00
"description": "The exposed hostname that will route to the Node.js service, if left blank a value will be defaulted.",
"value": ""
2015-06-17 15:45:09 +00:00
},
{
"name": "GITHUB_WEBHOOK_SECRET",
"displayName": "GitHub webhook secret",
2015-06-17 15:45:09 +00:00
"description": "A secret string used to configure the GitHub webhook",
"generate": "expression",
"from": "[a-zA-Z0-9]{40}"
},
{
"name": "GENERIC_WEBHOOK_SECRET",
"displayName": "Generic webhook secret",
"description": "A secret string used to configure the Generic webhook",
"generate": "expression",
"from": "[a-zA-Z0-9]{40}"
},
2015-06-17 15:45:09 +00:00
{
"name": "DATABASE_SERVICE_NAME",
"displayName": "Database service name",
2015-06-17 15:45:09 +00:00
"description": "Database service name",
"value": "mongodb"
},
{
2015-07-31 18:18:23 +00:00
"name": "DATABASE_USER",
"displayName": "MongoDB user name",
2015-06-17 15:45:09 +00:00
"description": "Username for MongoDB user that will be used for accessing the database",
"generate": "expression",
"from": "user[A-Z0-9]{3}"
},
{
2015-07-31 18:18:23 +00:00
"name": "DATABASE_PASSWORD",
"displayName": "MongoDB password",
2015-06-17 15:45:09 +00:00
"description": "Password for the MongoDB user",
"generate": "expression",
"from": "[a-zA-Z0-9]{16}"
},
{
2015-07-31 18:18:23 +00:00
"name": "DATABASE_NAME",
"displayName": "Database name",
2015-06-17 15:45:09 +00:00
"description": "Database name",
"value": "sampledb"
},
{
2015-07-31 18:18:23 +00:00
"name": "DATABASE_ADMIN_PASSWORD",
"displayName": "Database administrator password",
2015-06-17 15:45:09 +00:00
"description": "Password for the database admin user",
"generate": "expression",
"from": "[a-zA-Z0-9]{16}"
}
]
}