eap6-mongodb-sti.json 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for EAP 6 MongDB applications built using STI.",
  7. "iconClass" : "icon-jboss"
  8. },
  9. "name": "eap6-mongodb-sti"
  10. },
  11. "labels": {
  12. "template": "eap6-mongodb-sti"
  13. },
  14. "parameters": [
  15. {
  16. "description": "EAP Release version, e.g. 6.4, etc.",
  17. "name": "EAP_RELEASE",
  18. "value": "6.4"
  19. },
  20. {
  21. "description": "The name for the application.",
  22. "name": "APPLICATION_NAME",
  23. "value": "eap-app"
  24. },
  25. {
  26. "description": "Custom hostname for service routes. Leave blank for default hostname, e.g.: <application-name>.<project>.<default-domain-suffix>",
  27. "name": "APPLICATION_HOSTNAME",
  28. "value": ""
  29. },
  30. {
  31. "description": "Git source URI for application",
  32. "name": "GIT_URI"
  33. },
  34. {
  35. "description": "Git branch/tag reference",
  36. "name": "GIT_REF",
  37. "value": "master"
  38. },
  39. {
  40. "description": "Path within Git project to build; empty for root project directory.",
  41. "name": "GIT_CONTEXT_DIR",
  42. "value": ""
  43. },
  44. {
  45. "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/mongodb",
  46. "name": "DB_JNDI",
  47. "value": ""
  48. },
  49. {
  50. "description": "Database name",
  51. "name": "DB_DATABASE",
  52. "value": "root"
  53. },
  54. {
  55. "description": "Queue names",
  56. "name": "HORNETQ_QUEUES",
  57. "value": ""
  58. },
  59. {
  60. "description": "Topic names",
  61. "name": "HORNETQ_TOPICS",
  62. "value": ""
  63. },
  64. {
  65. "description": "The name of the secret containing the keystore file",
  66. "name": "EAP_HTTPS_SECRET",
  67. "value": "eap-app-secret"
  68. },
  69. {
  70. "description": "The name of the keystore file within the secret",
  71. "name": "EAP_HTTPS_KEYSTORE",
  72. "value": "keystore.jks"
  73. },
  74. {
  75. "description": "The name associated with the server certificate",
  76. "name": "EAP_HTTPS_NAME",
  77. "value": ""
  78. },
  79. {
  80. "description": "The password for the keystore and certificate",
  81. "name": "EAP_HTTPS_PASSWORD",
  82. "value": ""
  83. },
  84. {
  85. "description": "Sets xa-pool/min-pool-size for the configured datasource.",
  86. "name": "DB_MIN_POOL_SIZE"
  87. },
  88. {
  89. "description": "Sets xa-pool/max-pool-size for the configured datasource.",
  90. "name": "DB_MAX_POOL_SIZE"
  91. },
  92. {
  93. "description": "Sets transaction-isolation for the configured datasource.",
  94. "name": "DB_TX_ISOLATION"
  95. },
  96. {
  97. "description": "Disable data file preallocation.",
  98. "name": "MONGODB_NOPREALLOC"
  99. },
  100. {
  101. "description": "Set MongoDB to use a smaller default data file size.",
  102. "name": "MONGODB_SMALLFILES"
  103. },
  104. {
  105. "description": "Runs MongoDB in a quiet mode that attempts to limit the amount of output.",
  106. "name": "MONGODB_QUIET"
  107. },
  108. {
  109. "description": "HornetQ cluster admin password",
  110. "name": "HORNETQ_CLUSTER_PASSWORD",
  111. "from": "[a-zA-Z0-9]{8}",
  112. "generate": "expression"
  113. },
  114. {
  115. "description": "Database user name",
  116. "name": "DB_USERNAME",
  117. "from": "user[a-zA-Z0-9]{3}",
  118. "generate": "expression"
  119. },
  120. {
  121. "description": "Database user password",
  122. "name": "DB_PASSWORD",
  123. "from": "[a-zA-Z0-9]{8}",
  124. "generate": "expression"
  125. },
  126. {
  127. "description": "Database admin password",
  128. "name": "DB_ADMIN_PASSWORD",
  129. "from": "[a-zA-Z0-9]{8}",
  130. "generate": "expression"
  131. },
  132. {
  133. "description": "Github trigger secret",
  134. "name": "GITHUB_TRIGGER_SECRET",
  135. "from": "[a-zA-Z0-9]{8}",
  136. "generate": "expression"
  137. },
  138. {
  139. "description": "Generic build trigger secret",
  140. "name": "GENERIC_TRIGGER_SECRET",
  141. "from": "[a-zA-Z0-9]{8}",
  142. "generate": "expression"
  143. }
  144. ],
  145. "objects": [
  146. {
  147. "kind": "Service",
  148. "apiVersion": "v1",
  149. "spec": {
  150. "ports": [
  151. {
  152. "port": 8080,
  153. "targetPort": 8080
  154. }
  155. ],
  156. "selector": {
  157. "deploymentConfig": "${APPLICATION_NAME}"
  158. }
  159. },
  160. "metadata": {
  161. "name": "${APPLICATION_NAME}",
  162. "labels": {
  163. "application": "${APPLICATION_NAME}"
  164. },
  165. "annotations": {
  166. "description": "The web server's http port."
  167. }
  168. }
  169. },
  170. {
  171. "kind": "Service",
  172. "apiVersion": "v1",
  173. "spec": {
  174. "ports": [
  175. {
  176. "port": 8443,
  177. "targetPort": 8443
  178. }
  179. ],
  180. "selector": {
  181. "deploymentConfig": "${APPLICATION_NAME}"
  182. }
  183. },
  184. "metadata": {
  185. "name": "secure-${APPLICATION_NAME}",
  186. "labels": {
  187. "application": "${APPLICATION_NAME}"
  188. },
  189. "annotations": {
  190. "description": "The web server's https port."
  191. }
  192. }
  193. },
  194. {
  195. "kind": "Service",
  196. "apiVersion": "v1",
  197. "spec": {
  198. "ports": [
  199. {
  200. "port": 8888,
  201. "targetPort": 8888
  202. }
  203. ],
  204. "portalIP": "None",
  205. "selector": {
  206. "deploymentConfig": "${APPLICATION_NAME}"
  207. }
  208. },
  209. "metadata": {
  210. "name": "${APPLICATION_NAME}-ping",
  211. "labels": {
  212. "application": "${APPLICATION_NAME}"
  213. },
  214. "annotations": {
  215. "description": "Ping service for clustered applications."
  216. }
  217. }
  218. },
  219. {
  220. "kind": "Service",
  221. "apiVersion": "v1",
  222. "spec": {
  223. "ports": [
  224. {
  225. "port": 27017,
  226. "targetPort": 27017
  227. }
  228. ],
  229. "selector": {
  230. "deploymentConfig": "${APPLICATION_NAME}-mongodb"
  231. }
  232. },
  233. "metadata": {
  234. "name": "${APPLICATION_NAME}-mongodb",
  235. "labels": {
  236. "application": "${APPLICATION_NAME}"
  237. },
  238. "annotations": {
  239. "description": "The database server's port."
  240. }
  241. }
  242. },
  243. {
  244. "kind": "Route",
  245. "apiVersion": "v1",
  246. "id": "${APPLICATION_NAME}-http-route",
  247. "metadata": {
  248. "name": "${APPLICATION_NAME}-http-route",
  249. "labels": {
  250. "application": "${APPLICATION_NAME}"
  251. },
  252. "annotations": {
  253. "description": "Route for application's http service."
  254. }
  255. },
  256. "spec": {
  257. "host": "${APPLICATION_HOSTNAME}",
  258. "to": {
  259. "name": "${APPLICATION_NAME}"
  260. }
  261. }
  262. },
  263. {
  264. "kind": "Route",
  265. "apiVersion": "v1",
  266. "id": "${APPLICATION_NAME}-https-route",
  267. "metadata": {
  268. "name": "${APPLICATION_NAME}-https-route",
  269. "labels": {
  270. "application": "${APPLICATION_NAME}"
  271. },
  272. "annotations": {
  273. "description": "Route for application's https service."
  274. }
  275. },
  276. "spec": {
  277. "host": "${APPLICATION_HOSTNAME}",
  278. "to": {
  279. "name": "secure-${APPLICATION_NAME}"
  280. },
  281. "tls": {
  282. "termination" : "passthrough"
  283. }
  284. }
  285. },
  286. {
  287. "kind": "ImageStream",
  288. "apiVersion": "v1",
  289. "metadata": {
  290. "name": "${APPLICATION_NAME}",
  291. "labels": {
  292. "application": "${APPLICATION_NAME}"
  293. }
  294. }
  295. },
  296. {
  297. "kind": "BuildConfig",
  298. "apiVersion": "v1",
  299. "metadata": {
  300. "name": "${APPLICATION_NAME}",
  301. "labels": {
  302. "application": "${APPLICATION_NAME}"
  303. }
  304. },
  305. "spec": {
  306. "source": {
  307. "type": "Git",
  308. "git": {
  309. "uri": "${GIT_URI}",
  310. "ref": "${GIT_REF}"
  311. },
  312. "contextDir":"${GIT_CONTEXT_DIR}"
  313. },
  314. "strategy": {
  315. "type": "Source",
  316. "sourceStrategy": {
  317. "from": {
  318. "kind": "ImageStreamTag",
  319. "namespace": "openshift",
  320. "name": "jboss-eap6-openshift:${EAP_RELEASE}"
  321. }
  322. }
  323. },
  324. "output": {
  325. "to": {
  326. "kind": "ImageStreamTag",
  327. "name": "${APPLICATION_NAME}:latest"
  328. }
  329. },
  330. "triggers": [
  331. {
  332. "type": "GitHub",
  333. "github": {
  334. "secret": "${GITHUB_TRIGGER_SECRET}"
  335. }
  336. },
  337. {
  338. "type": "Generic",
  339. "generic": {
  340. "secret": "${GENERIC_TRIGGER_SECRET}"
  341. }
  342. },
  343. {
  344. "type": "ImageChange",
  345. "imageChange": {}
  346. }
  347. ]
  348. }
  349. },
  350. {
  351. "kind": "DeploymentConfig",
  352. "apiVersion": "v1",
  353. "metadata": {
  354. "name": "${APPLICATION_NAME}",
  355. "labels": {
  356. "application": "${APPLICATION_NAME}"
  357. }
  358. },
  359. "spec": {
  360. "strategy": {
  361. "type": "Recreate"
  362. },
  363. "triggers": [
  364. {
  365. "type": "ImageChange",
  366. "imageChangeParams": {
  367. "automatic": true,
  368. "containerNames": [
  369. "${APPLICATION_NAME}"
  370. ],
  371. "from": {
  372. "kind": "ImageStream",
  373. "name": "${APPLICATION_NAME}"
  374. }
  375. }
  376. }
  377. ],
  378. "replicas": 1,
  379. "selector": {
  380. "deploymentConfig": "${APPLICATION_NAME}"
  381. },
  382. "template": {
  383. "metadata": {
  384. "name": "${APPLICATION_NAME}",
  385. "labels": {
  386. "deploymentConfig": "${APPLICATION_NAME}",
  387. "application": "${APPLICATION_NAME}"
  388. }
  389. },
  390. "spec": {
  391. "serviceAccount": "eap-service-account",
  392. "containers": [
  393. {
  394. "name": "${APPLICATION_NAME}",
  395. "image": "${APPLICATION_NAME}",
  396. "imagePullPolicy": "Always",
  397. "volumeMounts": [
  398. {
  399. "name": "eap-keystore-volume",
  400. "mountPath": "/etc/eap-secret-volume",
  401. "readOnly": true
  402. }
  403. ],
  404. "readinessProbe": {
  405. "exec": {
  406. "command": [
  407. "/bin/bash",
  408. "-c",
  409. "/opt/eap/bin/readinessProbe.sh"
  410. ]
  411. }
  412. },
  413. "ports": [
  414. {
  415. "name": "http",
  416. "containerPort": 8080,
  417. "protocol": "TCP"
  418. },
  419. {
  420. "name": "https",
  421. "containerPort": 8443,
  422. "protocol": "TCP"
  423. },
  424. {
  425. "name": "ping",
  426. "containerPort": 8888,
  427. "protocol": "TCP"
  428. }
  429. ],
  430. "env": [
  431. {
  432. "name": "DB_SERVICE_PREFIX_MAPPING",
  433. "value": "${APPLICATION_NAME}-mongodb=DB"
  434. },
  435. {
  436. "name": "DB_JNDI",
  437. "value": "${DB_JNDI}"
  438. },
  439. {
  440. "name": "DB_USERNAME",
  441. "value": "${DB_USERNAME}"
  442. },
  443. {
  444. "name": "DB_PASSWORD",
  445. "value": "${DB_PASSWORD}"
  446. },
  447. {
  448. "name": "DB_DATABASE",
  449. "value": "${DB_DATABASE}"
  450. },
  451. {
  452. "name": "DB_ADMIN_PASSWORD",
  453. "value": "${DB_ADMIN_PASSWORD}"
  454. },
  455. {
  456. "name": "DB_MIN_POOL_SIZE",
  457. "value": "${DB_MIN_POOL_SIZE}"
  458. },
  459. {
  460. "name": "DB_MAX_POOL_SIZE",
  461. "value": "${DB_MAX_POOL_SIZE}"
  462. },
  463. {
  464. "name": "DB_TX_ISOLATION",
  465. "value": "${DB_TX_ISOLATION}"
  466. },
  467. {
  468. "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
  469. "value": "${APPLICATION_NAME}-ping"
  470. },
  471. {
  472. "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
  473. "value": "8888"
  474. },
  475. {
  476. "name": "EAP_HTTPS_KEYSTORE_DIR",
  477. "value": "/etc/eap-secret-volume"
  478. },
  479. {
  480. "name": "EAP_HTTPS_KEYSTORE",
  481. "value": "${EAP_HTTPS_KEYSTORE}"
  482. },
  483. {
  484. "name": "EAP_HTTPS_NAME",
  485. "value": "${EAP_HTTPS_NAME}"
  486. },
  487. {
  488. "name": "EAP_HTTPS_PASSWORD",
  489. "value": "${EAP_HTTPS_PASSWORD}"
  490. },
  491. {
  492. "name": "HORNETQ_CLUSTER_PASSWORD",
  493. "value": "${HORNETQ_CLUSTER_PASSWORD}"
  494. },
  495. {
  496. "name": "HORNETQ_QUEUES",
  497. "value": "${HORNETQ_QUEUES}"
  498. },
  499. {
  500. "name": "HORNETQ_TOPICS",
  501. "value": "${HORNETQ_TOPICS}"
  502. }
  503. ]
  504. }
  505. ],
  506. "volumes": [
  507. {
  508. "name": "eap-keystore-volume",
  509. "secret": {
  510. "secretName": "${EAP_HTTPS_SECRET}"
  511. }
  512. }
  513. ]
  514. }
  515. }
  516. }
  517. },
  518. {
  519. "kind": "DeploymentConfig",
  520. "apiVersion": "v1",
  521. "metadata": {
  522. "name": "${APPLICATION_NAME}-mongodb",
  523. "labels": {
  524. "application": "${APPLICATION_NAME}"
  525. }
  526. },
  527. "spec": {
  528. "strategy": {
  529. "type": "Recreate"
  530. },
  531. "triggers": [
  532. {
  533. "type": "ImageChange",
  534. "imageChangeParams": {
  535. "automatic": true,
  536. "containerNames": [
  537. "${APPLICATION_NAME}-mongodb"
  538. ],
  539. "from": {
  540. "kind": "ImageStreamTag",
  541. "namespace": "openshift",
  542. "name": "mongodb:latest"
  543. }
  544. }
  545. }
  546. ],
  547. "replicas": 1,
  548. "selector": {
  549. "deploymentConfig": "${APPLICATION_NAME}-mongodb"
  550. },
  551. "template": {
  552. "metadata": {
  553. "name": "${APPLICATION_NAME}-mongodb",
  554. "labels": {
  555. "deploymentConfig": "${APPLICATION_NAME}-mongodb",
  556. "application": "${APPLICATION_NAME}"
  557. }
  558. },
  559. "spec": {
  560. "containers": [
  561. {
  562. "name": "${APPLICATION_NAME}-mongodb",
  563. "image": "mongodb",
  564. "imagePullPolicy": "Always",
  565. "ports": [
  566. {
  567. "containerPort": 27017,
  568. "protocol": "TCP"
  569. }
  570. ],
  571. "env": [
  572. {
  573. "name": "MONGODB_USER",
  574. "value": "${DB_USERNAME}"
  575. },
  576. {
  577. "name": "MONGODB_PASSWORD",
  578. "value": "${DB_PASSWORD}"
  579. },
  580. {
  581. "name": "MONGODB_DATABASE",
  582. "value": "${DB_DATABASE}"
  583. },
  584. {
  585. "name": "MONGODB_ADMIN_PASSWORD",
  586. "value": "${DB_ADMIN_PASSWORD}"
  587. },
  588. {
  589. "name": "MONGODB_NOPREALLOC",
  590. "value": "${MONGODB_NOPREALLOC}"
  591. },
  592. {
  593. "name": "MONGODB_SMALLFILES",
  594. "value": "${MONGODB_SMALLFILES}"
  595. },
  596. {
  597. "name": "MONGODB_QUIET",
  598. "value": "${MONGODB_QUIET}"
  599. }
  600. ]
  601. }
  602. ]
  603. }
  604. }
  605. }
  606. }
  607. ]
  608. }