{ "kind": "Template", "apiVersion": "template.openshift.io/v1", "metadata": { "name": "nodejs-helloworld-sample", "annotations": { "description": "This example shows how to create a simple nodejs application in openshift origin v3", "iconClass": "icon-nodejs", "tags": "instant-app,nodejs" } }, "objects": [ { "kind": "Service", "apiVersion": "v1", "metadata": { "name": "frontend-prod" }, "spec": { "ports": [ { "name": "web", "protocol": "TCP", "port": 8080, "targetPort": 8080, "nodePort": 0 } ], "selector": { "name": "frontend-prod" }, "type": "ClusterIP", "sessionAffinity": "None" }, "status": { "loadBalancer": {} } }, { "kind": "Route", "apiVersion": "route.openshift.io/v1", "metadata": { "name": "frontend" }, "spec": { "to": { "kind": "Service", "name": "frontend" }, "tls": { "termination": "edge" } } }, { "kind": "DeploymentConfig", "apiVersion": "apps.openshift.io/v1", "metadata": { "name": "frontend-prod" }, "spec": { "strategy": { "type": "Rolling", "rollingParams": { "updatePeriodSeconds": 1, "intervalSeconds": 1, "timeoutSeconds": 120 } }, "triggers": [ { "type": "ImageChange", "imageChangeParams": { "automatic": true, "containerNames": [ "nodejs-helloworld" ], "from": { "kind": "ImageStreamTag", "name": "origin-nodejs-sample:prod" } } }, { "type": "ConfigChange" } ], "replicas": 1, "selector": { "name":"frontend-prod" }, "template": { "metadata": { "labels": { "name": "frontend-prod" } }, "spec": { "containers": [ { "name": "nodejs-helloworld", "image": " ", "ports": [ { "containerPort": 8080, "protocol": "TCP" } ], "resources": { "limits": { "memory": "${MEMORY_LIMIT}" } }, "terminationMessagePath": "/dev/termination-log", "imagePullPolicy": "IfNotPresent", "securityContext": { "capabilities": {}, "privileged": false } } ], "restartPolicy": "Always", "dnsPolicy": "ClusterFirst" } } } }, { "kind": "Service", "apiVersion": "v1", "metadata": { "name": "frontend" }, "spec": { "ports": [ { "name": "web", "protocol": "TCP", "port": 8080, "targetPort": 8080, "nodePort": 0 } ], "selector": { "name": "frontend" }, "type": "ClusterIP", "sessionAffinity": "None" } }, { "kind": "ImageStream", "apiVersion": "image.openshift.io/v1", "metadata": { "name": "origin-nodejs-sample" } }, { "kind": "ImageStream", "apiVersion": "image.openshift.io/v1", "metadata": { "name": "origin-nodejs-sample2" } }, { "kind": "ImageStream", "apiVersion": "image.openshift.io/v1", "metadata": { "name": "origin-nodejs-sample3" } }, { "kind": "ImageStream", "apiVersion": "image.openshift.io/v1", "metadata": { "name": "nodejs-010-centos7" }, "spec": { "dockerImageRepository": "${NAMESPACE}/nodejs-010-centos7" } }, { "kind": "BuildConfig", "apiVersion": "build.openshift.io/v1", "metadata": { "name": "frontend", "labels": { "name": "nodejs-sample-build" } }, "spec": { "triggers": [ { "type": "GitHub", "github": { "secret": "secret101" } }, { "type": "Generic", "generic": { "secret": "secret101" } } ], "source": { "type": "Git", "git": { "uri": "https://github.com/openshift/nodejs-ex.git" } }, "strategy": { "type": "Source", "sourceStrategy": { "from": { "kind": "ImageStreamTag", "name": "nodejs-010-centos7:latest" } } }, "output": { "to": { "kind": "ImageStreamTag", "name": "origin-nodejs-sample:latest" } }, "resources": {} } }, { "kind": "DeploymentConfig", "apiVersion": "apps.openshift.io/v1", "metadata": { "name": "frontend" }, "spec": { "strategy": { "type": "Rolling", "rollingParams": { "updatePeriodSeconds": 1, "intervalSeconds": 1, "timeoutSeconds": 120 } }, "triggers": [ { "type": "ImageChange", "imageChangeParams": { "automatic": false, "containerNames": [ "nodejs-helloworld" ], "from": { "kind": "ImageStreamTag", "name": "origin-nodejs-sample:latest" } } }, { "type": "ConfigChange" } ], "replicas": 1, "selector": { "name":"frontend" }, "template": { "metadata": { "labels": { "name": "frontend" } }, "spec": { "containers": [ { "name": "nodejs-helloworld", "image": " ", "ports": [ { "containerPort": 8080, "protocol": "TCP" } ], "resources": { "limits": { "memory": "${MEMORY_LIMIT}" } }, "terminationMessagePath": "/dev/termination-log", "imagePullPolicy": "IfNotPresent", "securityContext": { "capabilities": {}, "privileged": false } } ], "restartPolicy": "Always", "dnsPolicy": "ClusterFirst" } } } } ], "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": "ADMIN_USERNAME", "displayName": "Administrator Username", "description": "Username for the administrator of this application.", "generate": "expression", "from": "admin[A-Z0-9]{3}" }, { "name": "ADMIN_PASSWORD", "displayName": "Administrator Password", "description": "Password for the administrator of this application.", "generate": "expression", "from": "[a-zA-Z0-9]{8}" } ], "labels": { "template": "application-template-stibuild" } }