eap64-mongodb-s2i.json 23 KB

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