openshift.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "name": "parse-server-example",
  6. "annotations": {
  7. "description": "An example Parse API server using the parse-server module",
  8. "tags": "quickstart,nodejs,mongodb,parse",
  9. "iconClass": "icon-nodejs"
  10. }
  11. },
  12. "labels": {
  13. "template": "parse-server-example"
  14. },
  15. "objects": [
  16. {
  17. "kind": "Service",
  18. "apiVersion": "v1",
  19. "metadata": {
  20. "name": "${NAME}",
  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": "${NAME}"
  35. }
  36. }
  37. },
  38. {
  39. "kind": "Route",
  40. "apiVersion": "v1",
  41. "metadata": {
  42. "name": "${NAME}"
  43. },
  44. "spec": {
  45. "host": "${APPLICATION_DOMAIN}",
  46. "to": {
  47. "kind": "Service",
  48. "name": "${NAME}"
  49. }
  50. }
  51. },
  52. {
  53. "kind": "ImageStream",
  54. "apiVersion": "v1",
  55. "metadata": {
  56. "name": "${NAME}",
  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": "${NAME}",
  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": "${NAMESPACE}",
  86. "name": "nodejs:4"
  87. },
  88. "env": [
  89. {
  90. "name": "NPM_MIRROR",
  91. "value": "${NPM_MIRROR}"
  92. }
  93. ]
  94. }
  95. },
  96. "output": {
  97. "to": {
  98. "kind": "ImageStreamTag",
  99. "name": "${NAME}:latest"
  100. }
  101. },
  102. "triggers": [
  103. {
  104. "type": "ImageChange"
  105. },
  106. {
  107. "type": "ConfigChange"
  108. },
  109. {
  110. "type": "GitHub",
  111. "github": {
  112. "secret": "${GITHUB_WEBHOOK_SECRET}"
  113. }
  114. },
  115. {
  116. "type": "Generic",
  117. "generic": {
  118. "secret": "${GENERIC_WEBHOOK_SECRET}"
  119. }
  120. }
  121. ],
  122. "postCommit": {
  123. "script": "npm test"
  124. }
  125. }
  126. },
  127. {
  128. "kind": "DeploymentConfig",
  129. "apiVersion": "v1",
  130. "metadata": {
  131. "name": "${NAME}",
  132. "annotations": {
  133. "description": "Defines how to deploy the application server"
  134. }
  135. },
  136. "spec": {
  137. "strategy": {
  138. "type": "Rolling"
  139. },
  140. "triggers": [
  141. {
  142. "type": "ImageChange",
  143. "imageChangeParams": {
  144. "automatic": true,
  145. "containerNames": [
  146. "parse-server-example"
  147. ],
  148. "from": {
  149. "kind": "ImageStreamTag",
  150. "name": "${NAME}:latest"
  151. }
  152. }
  153. },
  154. {
  155. "type": "ConfigChange"
  156. }
  157. ],
  158. "replicas": 1,
  159. "selector": {
  160. "name": "${NAME}"
  161. },
  162. "template": {
  163. "metadata": {
  164. "name": "${NAME}",
  165. "labels": {
  166. "name": "${NAME}"
  167. }
  168. },
  169. "spec": {
  170. "containers": [
  171. {
  172. "name": "parse-server-example",
  173. "image": " ",
  174. "ports": [
  175. {
  176. "containerPort": 8080
  177. }
  178. ],
  179. "env": [
  180. {
  181. "name": "DATABASE_SERVICE_NAME",
  182. "value": "${DATABASE_SERVICE_NAME}"
  183. },
  184. {
  185. "name": "MONGODB_USER",
  186. "value": "${DATABASE_USER}"
  187. },
  188. {
  189. "name": "MONGODB_PASSWORD",
  190. "value": "${DATABASE_PASSWORD}"
  191. },
  192. {
  193. "name": "MONGODB_DATABASE",
  194. "value": "${DATABASE_NAME}"
  195. },
  196. {
  197. "name": "MONGODB_ADMIN_PASSWORD",
  198. "value": "${DATABASE_ADMIN_PASSWORD}"
  199. },
  200. {
  201. "name": "PORT",
  202. "value": "8080"
  203. },
  204. {
  205. "name": "DATABASE_URI",
  206. "value": "mongodb://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_SERVICE_NAME}/${DATABASE_NAME}"
  207. },
  208. {
  209. "name": "APP_ID",
  210. "value": "${APP_ID}"
  211. },
  212. {
  213. "name": "MASTER_KEY",
  214. "value": "${MASTER_KEY}"
  215. },
  216. {
  217. "name": "PARSE_MOUNT",
  218. "value": "${PARSE_MOUNT}"
  219. }
  220. ],
  221. "readinessProbe": {
  222. "timeoutSeconds": 3,
  223. "initialDelaySeconds": 3,
  224. "httpGet": {
  225. "path": "/test",
  226. "port": 8080
  227. }
  228. },
  229. "livenessProbe": {
  230. "timeoutSeconds": 3,
  231. "initialDelaySeconds": 30,
  232. "httpGet": {
  233. "path": "/test",
  234. "port": 8080
  235. }
  236. },
  237. "resources": {
  238. "limits": {
  239. "memory": "${MEMORY_LIMIT}"
  240. }
  241. }
  242. }
  243. ]
  244. }
  245. }
  246. }
  247. },
  248. {
  249. "kind": "Service",
  250. "apiVersion": "v1",
  251. "metadata": {
  252. "name": "${DATABASE_SERVICE_NAME}",
  253. "annotations": {
  254. "description": "Exposes the database server"
  255. }
  256. },
  257. "spec": {
  258. "ports": [
  259. {
  260. "name": "mongodb",
  261. "port": 27017,
  262. "targetPort": 27017
  263. }
  264. ],
  265. "selector": {
  266. "name": "${DATABASE_SERVICE_NAME}"
  267. }
  268. }
  269. },
  270. {
  271. "kind": "PersistentVolumeClaim",
  272. "apiVersion": "v1",
  273. "metadata": {
  274. "name": "${DATABASE_SERVICE_NAME}"
  275. },
  276. "spec": {
  277. "accessModes": [
  278. "ReadWriteOnce"
  279. ],
  280. "resources": {
  281. "requests": {
  282. "storage": "${VOLUME_CAPACITY}"
  283. }
  284. }
  285. }
  286. },
  287. {
  288. "kind": "DeploymentConfig",
  289. "apiVersion": "v1",
  290. "metadata": {
  291. "name": "${DATABASE_SERVICE_NAME}",
  292. "annotations": {
  293. "description": "Defines how to deploy the database"
  294. }
  295. },
  296. "spec": {
  297. "strategy": {
  298. "type": "Recreate"
  299. },
  300. "triggers": [
  301. {
  302. "type": "ImageChange",
  303. "imageChangeParams": {
  304. "automatic": true,
  305. "containerNames": [
  306. "mongodb"
  307. ],
  308. "from": {
  309. "kind": "ImageStreamTag",
  310. "namespace": "${NAMESPACE}",
  311. "name": "mongodb:3.2"
  312. }
  313. }
  314. },
  315. {
  316. "type": "ConfigChange"
  317. }
  318. ],
  319. "replicas": 1,
  320. "selector": {
  321. "name": "${DATABASE_SERVICE_NAME}"
  322. },
  323. "template": {
  324. "metadata": {
  325. "name": "${DATABASE_SERVICE_NAME}",
  326. "labels": {
  327. "name": "${DATABASE_SERVICE_NAME}"
  328. }
  329. },
  330. "spec": {
  331. "containers": [
  332. {
  333. "name": "mongodb",
  334. "image": " ",
  335. "ports": [
  336. {
  337. "containerPort": 27017
  338. }
  339. ],
  340. "env": [
  341. {
  342. "name": "MONGODB_USER",
  343. "value": "${DATABASE_USER}"
  344. },
  345. {
  346. "name": "MONGODB_PASSWORD",
  347. "value": "${DATABASE_PASSWORD}"
  348. },
  349. {
  350. "name": "MONGODB_DATABASE",
  351. "value": "${DATABASE_NAME}"
  352. },
  353. {
  354. "name": "MONGODB_ADMIN_PASSWORD",
  355. "value": "${DATABASE_ADMIN_PASSWORD}"
  356. }
  357. ],
  358. "readinessProbe": {
  359. "timeoutSeconds": 1,
  360. "initialDelaySeconds": 3,
  361. "exec": {
  362. "command": [ "/bin/sh", "-i", "-c", "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""]
  363. }
  364. },
  365. "livenessProbe": {
  366. "timeoutSeconds": 1,
  367. "initialDelaySeconds": 30,
  368. "tcpSocket": {
  369. "port": 27017
  370. }
  371. },
  372. "resources": {
  373. "limits": {
  374. "memory": "${MEMORY_MONGODB_LIMIT}"
  375. }
  376. },
  377. "volumeMounts": [
  378. {
  379. "name": "${DATABASE_SERVICE_NAME}-data",
  380. "mountPath": "/var/lib/mongodb/data"
  381. }
  382. ]
  383. }
  384. ],
  385. "volumes": [
  386. {
  387. "name": "${DATABASE_SERVICE_NAME}-data",
  388. "persistentVolumeClaim": {
  389. "claimName": "${DATABASE_SERVICE_NAME}"
  390. }
  391. }
  392. ]
  393. }
  394. }
  395. }
  396. }
  397. ],
  398. "parameters": [
  399. {
  400. "name": "NAME",
  401. "displayName": "Name",
  402. "description": "The name assigned to all of the frontend objects defined in this template.",
  403. "required": true,
  404. "value": "parse-server-example"
  405. },
  406. {
  407. "name": "NAMESPACE",
  408. "displayName": "Namespace",
  409. "description": "The OpenShift Namespace where the ImageStream resides.",
  410. "required": true,
  411. "value": "openshift"
  412. },
  413. {
  414. "name": "MEMORY_LIMIT",
  415. "displayName": "Memory Limit",
  416. "description": "Maximum amount of memory the Node.js container can use.",
  417. "required": true,
  418. "value": "512Mi"
  419. },
  420. {
  421. "name": "MEMORY_MONGODB_LIMIT",
  422. "displayName": "Memory Limit (MongoDB)",
  423. "description": "Maximum amount of memory the MongoDB container can use.",
  424. "required": true,
  425. "value": "512Mi"
  426. },
  427. {
  428. "name": "VOLUME_CAPACITY",
  429. "displayName": "Volume Capacity",
  430. "description": "Volume space available for data, e.g. 512Mi, 2Gi",
  431. "value": "1Gi",
  432. "required": true
  433. },
  434. {
  435. "name": "SOURCE_REPOSITORY_URL",
  436. "displayName": "Git Repository URL",
  437. "description": "The URL of the repository with your application source code.",
  438. "required": true,
  439. "value": "https://github.com/ParsePlatform/parse-server-example.git"
  440. },
  441. {
  442. "name": "SOURCE_REPOSITORY_REF",
  443. "displayName": "Git Reference",
  444. "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
  445. },
  446. {
  447. "name": "CONTEXT_DIR",
  448. "displayName": "Context Directory",
  449. "description": "Set this to the relative path to your project if it is not in the root of your repository."
  450. },
  451. {
  452. "name": "APPLICATION_DOMAIN",
  453. "displayName": "Application Hostname",
  454. "description": "The exposed hostname that will route to the Node.js service, if left blank a value will be defaulted.",
  455. "value": ""
  456. },
  457. {
  458. "name": "GITHUB_WEBHOOK_SECRET",
  459. "displayName": "GitHub Webhook Secret",
  460. "description": "A secret string used to configure the GitHub webhook.",
  461. "generate": "expression",
  462. "from": "[a-zA-Z0-9]{40}"
  463. },
  464. {
  465. "name": "GENERIC_WEBHOOK_SECRET",
  466. "displayName": "Generic Webhook Secret",
  467. "description": "A secret string used to configure the Generic webhook.",
  468. "generate": "expression",
  469. "from": "[a-zA-Z0-9]{40}"
  470. },
  471. {
  472. "name": "DATABASE_SERVICE_NAME",
  473. "displayName": "Database Service Name",
  474. "required": true,
  475. "value": "mongodb"
  476. },
  477. {
  478. "name": "DATABASE_USER",
  479. "displayName": "MongoDB Username",
  480. "description": "Username for MongoDB user that will be used for accessing the database.",
  481. "generate": "expression",
  482. "from": "user[A-Z0-9]{3}"
  483. },
  484. {
  485. "name": "DATABASE_PASSWORD",
  486. "displayName": "MongoDB Password",
  487. "description": "Password for the MongoDB user.",
  488. "generate": "expression",
  489. "from": "[a-zA-Z0-9]{16}"
  490. },
  491. {
  492. "name": "DATABASE_NAME",
  493. "displayName": "Database Name",
  494. "required": true,
  495. "value": "sampledb"
  496. },
  497. {
  498. "name": "DATABASE_ADMIN_PASSWORD",
  499. "displayName": "Database Administrator Password",
  500. "description": "Password for the database admin user.",
  501. "generate": "expression",
  502. "from": "[a-zA-Z0-9]{16}"
  503. },
  504. {
  505. "name": "NPM_MIRROR",
  506. "displayName": "Custom NPM Mirror URL",
  507. "description": "The custom NPM mirror URL",
  508. "value": ""
  509. },
  510. {
  511. "name": "APP_ID",
  512. "displayName": "App's Unique Identifier",
  513. "description": "A unique identifier for your app",
  514. "value": ""
  515. },
  516. {
  517. "name": "MASTER_KEY",
  518. "displayName": "Parse Master Key",
  519. "description": "A key that overrides all permissions. Keep this secret",
  520. "value": ""
  521. },
  522. {
  523. "name": "PARSE_MOUNT",
  524. "displayName": "Parse API route",
  525. "description": "Configure Parse API route",
  526. "value": "/parse"
  527. }
  528. ]
  529. }