eap70-postgresql-s2i.json 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for EAP 7 PostgreSQL applications built using S2I.",
  7. "iconClass": "icon-jboss",
  8. "tags": "eap,postgresql,javaee,java,database,jboss,xpaas",
  9. "version": "1.3.2"
  10. },
  11. "name": "eap70-postgresql-s2i"
  12. },
  13. "labels": {
  14. "template": "eap70-postgresql-s2i",
  15. "xpaas": "1.3.2"
  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 http service route. Leave blank for default hostname, e.g.: <application-name>-<project>.<default-domain-suffix>",
  26. "name": "HOSTNAME_HTTP",
  27. "value": "",
  28. "required": false
  29. },
  30. {
  31. "description": "Custom hostname for https service route. Leave blank for default hostname, e.g.: secure-<application-name>-<project>.<default-domain-suffix>",
  32. "name": "HOSTNAME_HTTPS",
  33. "value": "",
  34. "required": false
  35. },
  36. {
  37. "description": "Git source URI for application",
  38. "name": "SOURCE_REPOSITORY_URL",
  39. "value": "https://github.com/jboss-openshift/openshift-quickstarts",
  40. "required": true
  41. },
  42. {
  43. "description": "Git branch/tag reference",
  44. "name": "SOURCE_REPOSITORY_REF",
  45. "value": "1.3",
  46. "required": false
  47. },
  48. {
  49. "description": "Path within Git project to build; empty for root project directory.",
  50. "name": "CONTEXT_DIR",
  51. "value": "todolist/todolist-jdbc",
  52. "required": false
  53. },
  54. {
  55. "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/postgresql",
  56. "name": "DB_JNDI",
  57. "value": "java:jboss/datasources/TodoListDS",
  58. "required": false
  59. },
  60. {
  61. "description": "Database name",
  62. "name": "DB_DATABASE",
  63. "value": "root",
  64. "required": true
  65. },
  66. {
  67. "description": "Queue names",
  68. "name": "MQ_QUEUES",
  69. "value": "",
  70. "required": false
  71. },
  72. {
  73. "description": "Topic names",
  74. "name": "MQ_TOPICS",
  75. "value": "",
  76. "required": false
  77. },
  78. {
  79. "description": "The name of the service account to use for the deployment. The service account should be configured to allow useage of the secret(s) specified by HTTPS_SECRET and JGROUPS_ENCRYPT_SECRET.",
  80. "name": "SERVICE_ACCOUNT_NAME",
  81. "value": "eap7-service-account",
  82. "required": true
  83. },
  84. {
  85. "description": "The name of the secret containing the keystore file",
  86. "name": "HTTPS_SECRET",
  87. "value": "eap7-app-secret",
  88. "required": false
  89. },
  90. {
  91. "description": "The name of the keystore file within the secret",
  92. "name": "HTTPS_KEYSTORE",
  93. "value": "keystore.jks",
  94. "required": false
  95. },
  96. {
  97. "description": "The type of the keystore file (JKS or JCEKS)",
  98. "name": "HTTPS_KEYSTORE_TYPE",
  99. "value": "",
  100. "required": false
  101. },
  102. {
  103. "description": "The name associated with the server certificate",
  104. "name": "HTTPS_NAME",
  105. "value": "",
  106. "required": false
  107. },
  108. {
  109. "description": "The password for the keystore and certificate",
  110. "name": "HTTPS_PASSWORD",
  111. "value": "",
  112. "required": false
  113. },
  114. {
  115. "description": "Sets xa-pool/min-pool-size for the configured datasource.",
  116. "name": "DB_MIN_POOL_SIZE",
  117. "required": false
  118. },
  119. {
  120. "description": "Sets xa-pool/max-pool-size for the configured datasource.",
  121. "name": "DB_MAX_POOL_SIZE",
  122. "required": false
  123. },
  124. {
  125. "description": "Sets transaction-isolation for the configured datasource.",
  126. "name": "DB_TX_ISOLATION",
  127. "required": false
  128. },
  129. {
  130. "description": "The maximum number of client connections allowed. This also sets the maximum number of prepared transactions.",
  131. "name": "POSTGRESQL_MAX_CONNECTIONS",
  132. "required": false
  133. },
  134. {
  135. "description": "Configures how much memory is dedicated to PostgreSQL for caching data.",
  136. "name": "POSTGRESQL_SHARED_BUFFERS",
  137. "required": false
  138. },
  139. {
  140. "description": "A-MQ cluster admin password",
  141. "name": "MQ_CLUSTER_PASSWORD",
  142. "from": "[a-zA-Z0-9]{8}",
  143. "generate": "expression",
  144. "required": true
  145. },
  146. {
  147. "description": "Database user name",
  148. "name": "DB_USERNAME",
  149. "from": "user[a-zA-Z0-9]{3}",
  150. "generate": "expression",
  151. "required": true
  152. },
  153. {
  154. "description": "Database user password",
  155. "name": "DB_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. "description": "The name of the secret containing the keystore file",
  182. "name": "JGROUPS_ENCRYPT_SECRET",
  183. "value": "eap7-app-secret",
  184. "required": false
  185. },
  186. {
  187. "description": "The name of the keystore file within the secret",
  188. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  189. "value": "jgroups.jceks",
  190. "required": false
  191. },
  192. {
  193. "description": "The name associated with the server certificate",
  194. "name": "JGROUPS_ENCRYPT_NAME",
  195. "value": "",
  196. "required": false
  197. },
  198. {
  199. "description": "The password for the keystore and certificate",
  200. "name": "JGROUPS_ENCRYPT_PASSWORD",
  201. "value": "",
  202. "required": false
  203. },
  204. {
  205. "description": "JGroups cluster password",
  206. "name": "JGROUPS_CLUSTER_PASSWORD",
  207. "from": "[a-zA-Z0-9]{8}",
  208. "generate": "expression",
  209. "required": true
  210. },
  211. {
  212. "description": "Controls whether exploded deployment content should be automatically deployed",
  213. "name": "AUTO_DEPLOY_EXPLODED",
  214. "value": "false",
  215. "required": false
  216. }
  217. ],
  218. "objects": [
  219. {
  220. "kind": "Service",
  221. "apiVersion": "v1",
  222. "spec": {
  223. "ports": [
  224. {
  225. "port": 8080,
  226. "targetPort": 8080
  227. }
  228. ],
  229. "selector": {
  230. "deploymentConfig": "${APPLICATION_NAME}"
  231. }
  232. },
  233. "metadata": {
  234. "name": "${APPLICATION_NAME}",
  235. "labels": {
  236. "application": "${APPLICATION_NAME}"
  237. },
  238. "annotations": {
  239. "description": "The web server's http port."
  240. }
  241. }
  242. },
  243. {
  244. "kind": "Service",
  245. "apiVersion": "v1",
  246. "spec": {
  247. "ports": [
  248. {
  249. "port": 8443,
  250. "targetPort": 8443
  251. }
  252. ],
  253. "selector": {
  254. "deploymentConfig": "${APPLICATION_NAME}"
  255. }
  256. },
  257. "metadata": {
  258. "name": "secure-${APPLICATION_NAME}",
  259. "labels": {
  260. "application": "${APPLICATION_NAME}"
  261. },
  262. "annotations": {
  263. "description": "The web server's https port."
  264. }
  265. }
  266. },
  267. {
  268. "kind": "Service",
  269. "apiVersion": "v1",
  270. "spec": {
  271. "ports": [
  272. {
  273. "port": 5432,
  274. "targetPort": 5432
  275. }
  276. ],
  277. "selector": {
  278. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  279. }
  280. },
  281. "metadata": {
  282. "name": "${APPLICATION_NAME}-postgresql",
  283. "labels": {
  284. "application": "${APPLICATION_NAME}"
  285. },
  286. "annotations": {
  287. "description": "The database server's port."
  288. }
  289. }
  290. },
  291. {
  292. "kind": "Route",
  293. "apiVersion": "v1",
  294. "id": "${APPLICATION_NAME}-http",
  295. "metadata": {
  296. "name": "${APPLICATION_NAME}",
  297. "labels": {
  298. "application": "${APPLICATION_NAME}"
  299. },
  300. "annotations": {
  301. "description": "Route for application's http service."
  302. }
  303. },
  304. "spec": {
  305. "host": "${HOSTNAME_HTTP}",
  306. "to": {
  307. "name": "${APPLICATION_NAME}"
  308. }
  309. }
  310. },
  311. {
  312. "kind": "Route",
  313. "apiVersion": "v1",
  314. "id": "${APPLICATION_NAME}-https",
  315. "metadata": {
  316. "name": "secure-${APPLICATION_NAME}",
  317. "labels": {
  318. "application": "${APPLICATION_NAME}"
  319. },
  320. "annotations": {
  321. "description": "Route for application's https service."
  322. }
  323. },
  324. "spec": {
  325. "host": "${HOSTNAME_HTTPS}",
  326. "to": {
  327. "name": "secure-${APPLICATION_NAME}"
  328. },
  329. "tls": {
  330. "termination": "passthrough"
  331. }
  332. }
  333. },
  334. {
  335. "kind": "ImageStream",
  336. "apiVersion": "v1",
  337. "metadata": {
  338. "name": "${APPLICATION_NAME}",
  339. "labels": {
  340. "application": "${APPLICATION_NAME}"
  341. }
  342. }
  343. },
  344. {
  345. "kind": "BuildConfig",
  346. "apiVersion": "v1",
  347. "metadata": {
  348. "name": "${APPLICATION_NAME}",
  349. "labels": {
  350. "application": "${APPLICATION_NAME}"
  351. }
  352. },
  353. "spec": {
  354. "source": {
  355. "type": "Git",
  356. "git": {
  357. "uri": "${SOURCE_REPOSITORY_URL}",
  358. "ref": "${SOURCE_REPOSITORY_REF}"
  359. },
  360. "contextDir": "${CONTEXT_DIR}"
  361. },
  362. "strategy": {
  363. "type": "Source",
  364. "sourceStrategy": {
  365. "forcePull": true,
  366. "from": {
  367. "kind": "ImageStreamTag",
  368. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  369. "name": "jboss-eap70-openshift:1.4"
  370. }
  371. }
  372. },
  373. "output": {
  374. "to": {
  375. "kind": "ImageStreamTag",
  376. "name": "${APPLICATION_NAME}:latest"
  377. }
  378. },
  379. "triggers": [
  380. {
  381. "type": "GitHub",
  382. "github": {
  383. "secret": "${GITHUB_WEBHOOK_SECRET}"
  384. }
  385. },
  386. {
  387. "type": "Generic",
  388. "generic": {
  389. "secret": "${GENERIC_WEBHOOK_SECRET}"
  390. }
  391. },
  392. {
  393. "type": "ImageChange",
  394. "imageChange": {}
  395. },
  396. {
  397. "type": "ConfigChange"
  398. }
  399. ]
  400. }
  401. },
  402. {
  403. "kind": "DeploymentConfig",
  404. "apiVersion": "v1",
  405. "metadata": {
  406. "name": "${APPLICATION_NAME}",
  407. "labels": {
  408. "application": "${APPLICATION_NAME}"
  409. }
  410. },
  411. "spec": {
  412. "strategy": {
  413. "type": "Recreate"
  414. },
  415. "triggers": [
  416. {
  417. "type": "ImageChange",
  418. "imageChangeParams": {
  419. "automatic": true,
  420. "containerNames": [
  421. "${APPLICATION_NAME}"
  422. ],
  423. "from": {
  424. "kind": "ImageStreamTag",
  425. "name": "${APPLICATION_NAME}:latest"
  426. }
  427. }
  428. },
  429. {
  430. "type": "ConfigChange"
  431. }
  432. ],
  433. "replicas": 1,
  434. "selector": {
  435. "deploymentConfig": "${APPLICATION_NAME}"
  436. },
  437. "template": {
  438. "metadata": {
  439. "name": "${APPLICATION_NAME}",
  440. "labels": {
  441. "deploymentConfig": "${APPLICATION_NAME}",
  442. "application": "${APPLICATION_NAME}"
  443. }
  444. },
  445. "spec": {
  446. "serviceAccountName": "${SERVICE_ACCOUNT_NAME}",
  447. "terminationGracePeriodSeconds": 75,
  448. "containers": [
  449. {
  450. "name": "${APPLICATION_NAME}",
  451. "image": "${APPLICATION_NAME}",
  452. "imagePullPolicy": "Always",
  453. "volumeMounts": [
  454. {
  455. "name": "eap-keystore-volume",
  456. "mountPath": "/etc/eap-secret-volume",
  457. "readOnly": true
  458. },
  459. {
  460. "name": "eap-jgroups-keystore-volume",
  461. "mountPath": "/etc/jgroups-encrypt-secret-volume",
  462. "readOnly": true
  463. }
  464. ],
  465. "lifecycle": {
  466. "preStop": {
  467. "exec": {
  468. "command": [
  469. "/opt/eap/bin/jboss-cli.sh",
  470. "-c",
  471. ":shutdown(timeout=60)"
  472. ]
  473. }
  474. }
  475. },
  476. "livenessProbe": {
  477. "exec": {
  478. "command": [
  479. "/bin/bash",
  480. "-c",
  481. "/opt/eap/bin/livenessProbe.sh"
  482. ]
  483. }
  484. },
  485. "readinessProbe": {
  486. "exec": {
  487. "command": [
  488. "/bin/bash",
  489. "-c",
  490. "/opt/eap/bin/readinessProbe.sh"
  491. ]
  492. }
  493. },
  494. "ports": [
  495. {
  496. "name": "jolokia",
  497. "containerPort": 8778,
  498. "protocol": "TCP"
  499. },
  500. {
  501. "name": "http",
  502. "containerPort": 8080,
  503. "protocol": "TCP"
  504. },
  505. {
  506. "name": "https",
  507. "containerPort": 8443,
  508. "protocol": "TCP"
  509. },
  510. {
  511. "name": "ping",
  512. "containerPort": 8888,
  513. "protocol": "TCP"
  514. }
  515. ],
  516. "env": [
  517. {
  518. "name": "DB_SERVICE_PREFIX_MAPPING",
  519. "value": "${APPLICATION_NAME}-postgresql=DB"
  520. },
  521. {
  522. "name": "DB_JNDI",
  523. "value": "${DB_JNDI}"
  524. },
  525. {
  526. "name": "DB_USERNAME",
  527. "value": "${DB_USERNAME}"
  528. },
  529. {
  530. "name": "DB_PASSWORD",
  531. "value": "${DB_PASSWORD}"
  532. },
  533. {
  534. "name": "DB_DATABASE",
  535. "value": "${DB_DATABASE}"
  536. },
  537. {
  538. "name": "TX_DATABASE_PREFIX_MAPPING",
  539. "value": "${APPLICATION_NAME}-postgresql=DB"
  540. },
  541. {
  542. "name": "DB_MIN_POOL_SIZE",
  543. "value": "${DB_MIN_POOL_SIZE}"
  544. },
  545. {
  546. "name": "DB_MAX_POOL_SIZE",
  547. "value": "${DB_MAX_POOL_SIZE}"
  548. },
  549. {
  550. "name": "DB_TX_ISOLATION",
  551. "value": "${DB_TX_ISOLATION}"
  552. },
  553. {
  554. "name": "OPENSHIFT_KUBE_PING_LABELS",
  555. "value": "application=${APPLICATION_NAME}"
  556. },
  557. {
  558. "name": "OPENSHIFT_KUBE_PING_NAMESPACE",
  559. "valueFrom": {
  560. "fieldRef": {
  561. "fieldPath": "metadata.namespace"
  562. }
  563. }
  564. },
  565. {
  566. "name": "HTTPS_KEYSTORE_DIR",
  567. "value": "/etc/eap-secret-volume"
  568. },
  569. {
  570. "name": "HTTPS_KEYSTORE",
  571. "value": "${HTTPS_KEYSTORE}"
  572. },
  573. {
  574. "name": "HTTPS_KEYSTORE_TYPE",
  575. "value": "${HTTPS_KEYSTORE_TYPE}"
  576. },
  577. {
  578. "name": "HTTPS_NAME",
  579. "value": "${HTTPS_NAME}"
  580. },
  581. {
  582. "name": "HTTPS_PASSWORD",
  583. "value": "${HTTPS_PASSWORD}"
  584. },
  585. {
  586. "name": "MQ_CLUSTER_PASSWORD",
  587. "value": "${MQ_CLUSTER_PASSWORD}"
  588. },
  589. {
  590. "name": "MQ_QUEUES",
  591. "value": "${MQ_QUEUES}"
  592. },
  593. {
  594. "name": "MQ_TOPICS",
  595. "value": "${MQ_TOPICS}"
  596. },
  597. {
  598. "name": "JGROUPS_ENCRYPT_SECRET",
  599. "value": "${JGROUPS_ENCRYPT_SECRET}"
  600. },
  601. {
  602. "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR",
  603. "value": "/etc/jgroups-encrypt-secret-volume"
  604. },
  605. {
  606. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  607. "value": "${JGROUPS_ENCRYPT_KEYSTORE}"
  608. },
  609. {
  610. "name": "JGROUPS_ENCRYPT_NAME",
  611. "value": "${JGROUPS_ENCRYPT_NAME}"
  612. },
  613. {
  614. "name": "JGROUPS_ENCRYPT_PASSWORD",
  615. "value": "${JGROUPS_ENCRYPT_PASSWORD}"
  616. },
  617. {
  618. "name": "JGROUPS_CLUSTER_PASSWORD",
  619. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  620. },
  621. {
  622. "name": "AUTO_DEPLOY_EXPLODED",
  623. "value": "${AUTO_DEPLOY_EXPLODED}"
  624. },
  625. {
  626. "name": "DEFAULT_JOB_REPOSITORY",
  627. "value": "${APPLICATION_NAME}-postgresql"
  628. },
  629. {
  630. "name": "TIMER_SERVICE_DATA_STORE",
  631. "value": "${APPLICATION_NAME}-postgresql"
  632. }
  633. ]
  634. }
  635. ],
  636. "volumes": [
  637. {
  638. "name": "eap-keystore-volume",
  639. "secret": {
  640. "secretName": "${HTTPS_SECRET}"
  641. }
  642. },
  643. {
  644. "name": "eap-jgroups-keystore-volume",
  645. "secret": {
  646. "secretName": "${JGROUPS_ENCRYPT_SECRET}"
  647. }
  648. }
  649. ]
  650. }
  651. }
  652. }
  653. },
  654. {
  655. "kind": "DeploymentConfig",
  656. "apiVersion": "v1",
  657. "metadata": {
  658. "name": "${APPLICATION_NAME}-postgresql",
  659. "labels": {
  660. "application": "${APPLICATION_NAME}"
  661. }
  662. },
  663. "spec": {
  664. "strategy": {
  665. "type": "Recreate"
  666. },
  667. "triggers": [
  668. {
  669. "type": "ImageChange",
  670. "imageChangeParams": {
  671. "automatic": true,
  672. "containerNames": [
  673. "${APPLICATION_NAME}-postgresql"
  674. ],
  675. "from": {
  676. "kind": "ImageStreamTag",
  677. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  678. "name": "postgresql:latest"
  679. }
  680. }
  681. },
  682. {
  683. "type": "ConfigChange"
  684. }
  685. ],
  686. "replicas": 1,
  687. "selector": {
  688. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  689. },
  690. "template": {
  691. "metadata": {
  692. "name": "${APPLICATION_NAME}-postgresql",
  693. "labels": {
  694. "deploymentConfig": "${APPLICATION_NAME}-postgresql",
  695. "application": "${APPLICATION_NAME}"
  696. }
  697. },
  698. "spec": {
  699. "terminationGracePeriodSeconds": 60,
  700. "containers": [
  701. {
  702. "name": "${APPLICATION_NAME}-postgresql",
  703. "image": "postgresql",
  704. "imagePullPolicy": "Always",
  705. "ports": [
  706. {
  707. "containerPort": 5432,
  708. "protocol": "TCP"
  709. }
  710. ],
  711. "env": [
  712. {
  713. "name": "POSTGRESQL_USER",
  714. "value": "${DB_USERNAME}"
  715. },
  716. {
  717. "name": "POSTGRESQL_PASSWORD",
  718. "value": "${DB_PASSWORD}"
  719. },
  720. {
  721. "name": "POSTGRESQL_DATABASE",
  722. "value": "${DB_DATABASE}"
  723. },
  724. {
  725. "name": "POSTGRESQL_MAX_CONNECTIONS",
  726. "value": "${POSTGRESQL_MAX_CONNECTIONS}"
  727. },
  728. {
  729. "name": "POSTGRESQL_MAX_PREPARED_TRANSACTIONS",
  730. "value": "${POSTGRESQL_MAX_CONNECTIONS}"
  731. },
  732. {
  733. "name": "POSTGRESQL_SHARED_BUFFERS",
  734. "value": "${POSTGRESQL_SHARED_BUFFERS}"
  735. }
  736. ]
  737. }
  738. ]
  739. }
  740. }
  741. }
  742. }
  743. ]
  744. }