eap64-mongodb-persistent-s2i.json 25 KB

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