nodejs-ex/openshift/templates/nodejs.json
2015-06-16 11:53:43 +02:00

189 lines
4.4 KiB
JSON

{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-example",
"annotations": {
"description": "An example Node.js application with no database",
"tags": "instant-app,nodejs",
"iconClass": "icon-nodejs"
}
},
"labels": {
"template": "nodejs-example"
},
"objects": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-frontend",
"annotations": {
"description": "Exposes and load balances the application pods"
}
},
"spec": {
"ports": [
{
"name": "web",
"port": 8080,
"targetPort": 8080
}
],
"selector": {
"name": "nodejs-frontend"
}
}
},
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-route"
},
"spec": {
"host": "${FRONTEND_ROUTE}",
"to": {
"kind": "Service",
"name": "nodejs-frontend"
}
}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-example",
"annotations": {
"description": "Keeps track of changes in the application image"
}
}
},
{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-example",
"annotations": {
"description": "Defines how to build the application"
}
},
"spec": {
"source": {
"type": "Git",
"git": {
"uri": "${SOURCE_REPOSITORY_URL}"
},
"contextDir": "${CONTEXT_DIR}"
},
"strategy": {
"type": "Source",
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"namespace": "openshift",
"name": "nodejs:0.10"
}
}
},
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "nodejs-example:latest"
}
},
"triggers": [
{
"type": "ImageChange"
},
{
"type": "GitHub",
"github": {
"secret": "${GITHUB_WEBHOOK_SECRET}"
}
}
]
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "nodejs-frontend",
"annotations": {
"description": "Defines how to deploy the application server"
}
},
"spec": {
"strategy": {
"type": "Rolling"
},
"triggers": [
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"nodejs-example"
],
"from": {
"kind": "ImageStreamTag",
"name": "nodejs-example:latest"
}
}
},
{
"type": "ConfigChange"
}
],
"replicas": 1,
"selector": {
"name": "nodejs-frontend"
},
"template": {
"metadata": {
"name": "nodejs-frontend",
"labels": {
"name": "nodejs-frontend"
}
},
"spec": {
"containers": [
{
"name": "nodejs-example",
"image": "nodejs-example",
"ports": [
{
"containerPort": 8080
}
]
}
]
}
}
}
}
],
"parameters": [
{
"name": "SOURCE_REPOSITORY_URL",
"description": "The URL of the repository with your application source code",
"value": "https://github.com/openshift/nodejs-ex.git"
},
{
"name": "CONTEXT_DIR",
"description": "Set this to the relative path to your project if it is not in the root of your repository"
},
{
"name": "FRONTEND_ROUTE",
"description": "The exposed hostname that will route to the Node.js service",
"value": "nodejs.app"
},
{
"name": "GITHUB_WEBHOOK_SECRET",
"description": "A secret string used to configure the GitHub webhook",
"generate": "expression",
"from": "[a-zA-Z0-9]{40}"
}
]
}