nodejs.json 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "name": "nodejs-example",
  6. "annotations": {
  7. "description": "An example Node.js application with no database",
  8. "tags": "quickstart,nodejs",
  9. "iconClass": "icon-nodejs"
  10. }
  11. },
  12. "labels": {
  13. "template": "nodejs-example"
  14. },
  15. "objects": [
  16. {
  17. "kind": "Service",
  18. "apiVersion": "v1",
  19. "metadata": {
  20. "name": "nodejs-example",
  21. "annotations": {
  22. "description": "Exposes and load balances the application pods"
  23. }
  24. },
  25. "spec": {
  26. "ports": [
  27. {
  28. "name": "web",
  29. "port": 8080,
  30. "targetPort": 8080
  31. }
  32. ],
  33. "selector": {
  34. "name": "nodejs-example"
  35. }
  36. }
  37. },
  38. {
  39. "kind": "Route",
  40. "apiVersion": "v1",
  41. "metadata": {
  42. "name": "nodejs-example"
  43. },
  44. "spec": {
  45. "host": "${APPLICATION_DOMAIN}",
  46. "to": {
  47. "kind": "Service",
  48. "name": "nodejs-example"
  49. }
  50. }
  51. },
  52. {
  53. "kind": "ImageStream",
  54. "apiVersion": "v1",
  55. "metadata": {
  56. "name": "nodejs-example",
  57. "annotations": {
  58. "description": "Keeps track of changes in the application image"
  59. }
  60. }
  61. },
  62. {
  63. "kind": "BuildConfig",
  64. "apiVersion": "v1",
  65. "metadata": {
  66. "name": "nodejs-example",
  67. "annotations": {
  68. "description": "Defines how to build the application"
  69. }
  70. },
  71. "spec": {
  72. "source": {
  73. "type": "Git",
  74. "git": {
  75. "uri": "${SOURCE_REPOSITORY_URL}",
  76. "ref": "${SOURCE_REPOSITORY_REF}"
  77. },
  78. "contextDir": "${CONTEXT_DIR}"
  79. },
  80. "strategy": {
  81. "type": "Source",
  82. "sourceStrategy": {
  83. "from": {
  84. "kind": "ImageStreamTag",
  85. "namespace": "openshift",
  86. "name": "nodejs:0.10"
  87. }
  88. }
  89. },
  90. "output": {
  91. "to": {
  92. "kind": "ImageStreamTag",
  93. "name": "nodejs-example:latest"
  94. }
  95. },
  96. "triggers": [
  97. {
  98. "type": "ImageChange"
  99. },
  100. {
  101. "type": "ConfigChange"
  102. },
  103. {
  104. "type": "GitHub",
  105. "github": {
  106. "secret": "${GITHUB_WEBHOOK_SECRET}"
  107. }
  108. },
  109. {
  110. "type": "Generic",
  111. "generic": {
  112. "secret": "${GENERIC_WEBHOOK_SECRET}"
  113. }
  114. }
  115. ]
  116. }
  117. },
  118. {
  119. "kind": "DeploymentConfig",
  120. "apiVersion": "v1",
  121. "metadata": {
  122. "name": "nodejs-example",
  123. "annotations": {
  124. "description": "Defines how to deploy the application server"
  125. }
  126. },
  127. "spec": {
  128. "strategy": {
  129. "type": "Rolling"
  130. },
  131. "triggers": [
  132. {
  133. "type": "ImageChange",
  134. "imageChangeParams": {
  135. "automatic": true,
  136. "containerNames": [
  137. "nodejs-example"
  138. ],
  139. "from": {
  140. "kind": "ImageStreamTag",
  141. "name": "nodejs-example:latest"
  142. }
  143. }
  144. },
  145. {
  146. "type": "ConfigChange"
  147. }
  148. ],
  149. "replicas": 1,
  150. "selector": {
  151. "name": "nodejs-example"
  152. },
  153. "template": {
  154. "metadata": {
  155. "name": "nodejs-example",
  156. "labels": {
  157. "name": "nodejs-example"
  158. }
  159. },
  160. "spec": {
  161. "containers": [
  162. {
  163. "name": "nodejs-example",
  164. "image": "nodejs-example",
  165. "ports": [
  166. {
  167. "containerPort": 8080
  168. }
  169. ],
  170. "readinessProbe": {
  171. "timeoutSeconds": 3,
  172. "initialDelaySeconds": 3,
  173. "httpGet": {
  174. "path": "/",
  175. "port": 8080
  176. }
  177. },
  178. "livenessProbe": {
  179. "timeoutSeconds": 3,
  180. "initialDelaySeconds": 30,
  181. "httpGet": {
  182. "path": "/",
  183. "port": 8080
  184. }
  185. },
  186. "resources": {
  187. "limits": {
  188. "memory": "${MEMORY_LIMIT}"
  189. }
  190. },
  191. "env": [
  192. {
  193. "name": "DATABASE_SERVICE_NAME",
  194. "value": "${DATABASE_SERVICE_NAME}"
  195. },
  196. {
  197. "name": "MONGODB_USER",
  198. "value": "${MONGODB_USER}"
  199. },
  200. {
  201. "name": "MONGODB_PASSWORD",
  202. "value": "${MONGODB_PASSWORD}"
  203. },
  204. {
  205. "name": "MONGODB_DATABASE",
  206. "value": "${MONGODB_DATABASE}"
  207. },
  208. {
  209. "name": "MONGODB_ADMIN_PASSWORD",
  210. "value": "${MONGODB_ADMIN_PASSWORD}"
  211. }
  212. ],
  213. "resources": {
  214. "limits": {
  215. "memory": "${MEMORY_LIMIT}"
  216. }
  217. }
  218. }
  219. ]
  220. }
  221. }
  222. }
  223. }
  224. ],
  225. "parameters": [
  226. {
  227. "name": "MEMORY_LIMIT",
  228. "displayName": "Memory limit",
  229. "description": "Maximum amount of memory the container can use",
  230. "value": "512Mi"
  231. },
  232. {
  233. "name": "SOURCE_REPOSITORY_URL",
  234. "displayName": "Source repository URL",
  235. "description": "The URL of the repository with your application source code",
  236. "value": "https://github.com/openshift/nodejs-ex.git"
  237. },
  238. {
  239. "name": "SOURCE_REPOSITORY_REF",
  240. "displayName": "Source repository reference",
  241. "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch"
  242. },
  243. {
  244. "name": "CONTEXT_DIR",
  245. "displayName": "Context directory",
  246. "description": "Set this to the relative path to your project if it is not in the root of your repository"
  247. },
  248. {
  249. "name": "APPLICATION_DOMAIN",
  250. "displayName": "Application hostname",
  251. "description": "The exposed hostname that will route to the Node.js service, if left blank a value will be defaulted.",
  252. "value": ""
  253. },
  254. {
  255. "name": "GITHUB_WEBHOOK_SECRET",
  256. "displayName": "GitHub webhook secret",
  257. "description": "A secret string used to configure the GitHub webhook",
  258. "generate": "expression",
  259. "from": "[a-zA-Z0-9]{40}"
  260. },
  261. {
  262. "name": "GENERIC_WEBHOOK_SECRET",
  263. "displayName": "Generic webhook secret",
  264. "description": "A secret string used to configure the Generic webhook",
  265. "generate": "expression",
  266. "from": "[a-zA-Z0-9]{40}"
  267. },
  268. {
  269. "name": "DATABASE_SERVICE_NAME",
  270. "displayName": "Database service name",
  271. "description": "Database service name"
  272. },
  273. {
  274. "name": "MONGODB_USER",
  275. "displayName": "MongoDB user name",
  276. "description": "Username for MongoDB user that will be used for accessing the database"
  277. },
  278. {
  279. "name": "MONGODB_PASSWORD",
  280. "displayName": "MongoDB password",
  281. "description": "Password for the MongoDB user"
  282. },
  283. {
  284. "name": "MONGODB_DATABASE",
  285. "displayName": "Database name",
  286. "description": "Database name"
  287. },
  288. {
  289. "name": "MONGODB_ADMIN_PASSWORD",
  290. "displayName": "Database administrator password",
  291. "description": "Password for the database admin user"
  292. }
  293. ]
  294. }