eap-cd-postgresql-persistent-s2i.json 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "iconClass": "icon-eap",
  7. "tags": "eap,javaee,java,jboss",
  8. "version": "1.4.10",
  9. "openshift.io/display-name": "JBoss EAP CD + PostgreSQL (Persistent with https)",
  10. "openshift.io/provider-display-name": "Red Hat, Inc.",
  11. "description": "An example JBoss Enterprise Application Platform continuous delivery application with a persistent PostgreSQL database. For more information about using this template, see https://github.com/jboss-container-images/jboss-eap-7-openshift-image/blob/eap-cd/README.adoc",
  12. "template.openshift.io/long-description": "This template defines resources needed to develop a JBoss Enterprise Application Platform continuous delivery based application, including a build configuration, application deployment configuration, database deployment configuration for PostgreSQL using persistence and secure communication using https.",
  13. "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/",
  14. "template.openshift.io/support-url": "https://access.redhat.com"
  15. },
  16. "name": "eap-cd-postgresql-persistent-s2i"
  17. },
  18. "labels": {
  19. "template": "eap-cd-postgresql-persistent-s2i",
  20. "xpaas": "1.4.10"
  21. },
  22. "message": "A new JBoss EAP CD and PostgreSQL persistent based application with SSL support has been created in your project. The username/password for accessing the PostgreSQL database \"${DB_DATABASE}\" is ${DB_USERNAME}/${DB_PASSWORD}. Please be sure to create the following secrets: \"${HTTPS_SECRET}\" containing the ${HTTPS_KEYSTORE} file used for serving secure content; \"${JGROUPS_ENCRYPT_SECRET}\" containing the ${JGROUPS_ENCRYPT_KEYSTORE} file used for securing JGroups communications.",
  23. "parameters": [
  24. {
  25. "displayName": "Application Name",
  26. "description": "The name for the application.",
  27. "name": "APPLICATION_NAME",
  28. "value": "eap-app",
  29. "required": true
  30. },
  31. {
  32. "displayName": "Custom https Route Hostname",
  33. "description": "Custom hostname for https service route. Leave blank for default hostname, e.g.: secure-<application-name>-<project>.<default-domain-suffix>",
  34. "name": "HOSTNAME_HTTPS",
  35. "value": "",
  36. "required": false
  37. },
  38. {
  39. "displayName": "Git Repository URL",
  40. "description": "Git source URI for application",
  41. "name": "SOURCE_REPOSITORY_URL",
  42. "value": "https://github.com/jboss-openshift/openshift-quickstarts",
  43. "required": true
  44. },
  45. {
  46. "displayName": "Git Reference",
  47. "description": "Git branch/tag reference",
  48. "name": "SOURCE_REPOSITORY_REF",
  49. "value": "1.3",
  50. "required": false
  51. },
  52. {
  53. "displayName": "Context Directory",
  54. "description": "Path within Git project to build; empty for root project directory.",
  55. "name": "CONTEXT_DIR",
  56. "value": "todolist/todolist-jdbc",
  57. "required": false
  58. },
  59. {
  60. "displayName": "Database JNDI Name",
  61. "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/postgresql",
  62. "name": "DB_JNDI",
  63. "value": "java:jboss/datasources/TodoListDS",
  64. "required": false
  65. },
  66. {
  67. "displayName": "Database Name",
  68. "description": "Database name",
  69. "name": "DB_DATABASE",
  70. "value": "root",
  71. "required": true
  72. },
  73. {
  74. "displayName": "Database Volume Capacity",
  75. "description": "Size of persistent storage for database volume.",
  76. "name": "VOLUME_CAPACITY",
  77. "value": "1Gi",
  78. "required": true
  79. },
  80. {
  81. "displayName": "Queues",
  82. "description": "Queue names",
  83. "name": "MQ_QUEUES",
  84. "value": "",
  85. "required": false
  86. },
  87. {
  88. "displayName": "Topics",
  89. "description": "Topic names",
  90. "name": "MQ_TOPICS",
  91. "value": "",
  92. "required": false
  93. },
  94. {
  95. "displayName": "Server Keystore Secret Name",
  96. "description": "The name of the secret containing the keystore file",
  97. "name": "HTTPS_SECRET",
  98. "value": "eap7-app-secret",
  99. "required": true
  100. },
  101. {
  102. "displayName": "Server Keystore Filename",
  103. "description": "The name of the keystore file within the secret",
  104. "name": "HTTPS_KEYSTORE",
  105. "value": "keystore.jks",
  106. "required": false
  107. },
  108. {
  109. "displayName": "Server Keystore Type",
  110. "description": "The type of the keystore file (JKS or JCEKS)",
  111. "name": "HTTPS_KEYSTORE_TYPE",
  112. "value": "",
  113. "required": false
  114. },
  115. {
  116. "displayName": "Server Certificate Name",
  117. "description": "The name associated with the server certificate",
  118. "name": "HTTPS_NAME",
  119. "value": "",
  120. "required": false
  121. },
  122. {
  123. "displayName": "Server Keystore Password",
  124. "description": "The password for the keystore and certificate",
  125. "name": "HTTPS_PASSWORD",
  126. "value": "",
  127. "required": false
  128. },
  129. {
  130. "displayName": "Datasource Minimum Pool Size",
  131. "description": "Sets xa-pool/min-pool-size for the configured datasource.",
  132. "name": "DB_MIN_POOL_SIZE",
  133. "required": false
  134. },
  135. {
  136. "displayName": "Datasource Maximum Pool Size",
  137. "description": "Sets xa-pool/max-pool-size for the configured datasource.",
  138. "name": "DB_MAX_POOL_SIZE",
  139. "required": false
  140. },
  141. {
  142. "displayName": "Datasource Transaction Isolation",
  143. "description": "Sets transaction-isolation for the configured datasource.",
  144. "name": "DB_TX_ISOLATION",
  145. "required": false
  146. },
  147. {
  148. "displayName": "PostgreSQL Maximum number of connections",
  149. "description": "The maximum number of client connections allowed. This also sets the maximum number of prepared transactions.",
  150. "name": "POSTGRESQL_MAX_CONNECTIONS",
  151. "required": false
  152. },
  153. {
  154. "displayName": "PostgreSQL Shared Buffers",
  155. "description": "Configures how much memory is dedicated to PostgreSQL for caching data.",
  156. "name": "POSTGRESQL_SHARED_BUFFERS",
  157. "required": false
  158. },
  159. {
  160. "displayName": "A-MQ cluster password",
  161. "description": "A-MQ cluster admin password",
  162. "name": "MQ_CLUSTER_PASSWORD",
  163. "from": "[a-zA-Z0-9]{8}",
  164. "generate": "expression",
  165. "required": true
  166. },
  167. {
  168. "displayName": "Database Username",
  169. "description": "Database user name",
  170. "name": "DB_USERNAME",
  171. "from": "user[a-zA-Z0-9]{3}",
  172. "generate": "expression",
  173. "required": true
  174. },
  175. {
  176. "displayName": "Database Password",
  177. "description": "Database user password",
  178. "name": "DB_PASSWORD",
  179. "from": "[a-zA-Z0-9]{8}",
  180. "generate": "expression",
  181. "required": true
  182. },
  183. {
  184. "displayName": "Github Webhook Secret",
  185. "description": "GitHub trigger secret",
  186. "name": "GITHUB_WEBHOOK_SECRET",
  187. "from": "[a-zA-Z0-9]{8}",
  188. "generate": "expression",
  189. "required": true
  190. },
  191. {
  192. "displayName": "Generic Webhook Secret",
  193. "description": "Generic build trigger secret",
  194. "name": "GENERIC_WEBHOOK_SECRET",
  195. "from": "[a-zA-Z0-9]{8}",
  196. "generate": "expression",
  197. "required": true
  198. },
  199. {
  200. "displayName": "ImageStream Namespace",
  201. "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.",
  202. "name": "IMAGE_STREAM_NAMESPACE",
  203. "value": "openshift",
  204. "required": true
  205. },
  206. {
  207. "displayName": "JGroups Secret Name",
  208. "description": "The name of the secret containing the keystore file",
  209. "name": "JGROUPS_ENCRYPT_SECRET",
  210. "value": "eap7-app-secret",
  211. "required": false
  212. },
  213. {
  214. "displayName": "JGroups Keystore Filename",
  215. "description": "The name of the keystore file within the secret",
  216. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  217. "value": "jgroups.jceks",
  218. "required": false
  219. },
  220. {
  221. "displayName": "JGroups Certificate Name",
  222. "description": "The name associated with the server certificate",
  223. "name": "JGROUPS_ENCRYPT_NAME",
  224. "value": "",
  225. "required": false
  226. },
  227. {
  228. "displayName": "JGroups Keystore Password",
  229. "description": "The password for the keystore and certificate",
  230. "name": "JGROUPS_ENCRYPT_PASSWORD",
  231. "value": "",
  232. "required": false
  233. },
  234. {
  235. "displayName": "JGroups Cluster Password",
  236. "description": "JGroups cluster password",
  237. "name": "JGROUPS_CLUSTER_PASSWORD",
  238. "from": "[a-zA-Z0-9]{8}",
  239. "generate": "expression",
  240. "required": true
  241. },
  242. {
  243. "displayName": "Deploy Exploded Archives",
  244. "description": "Controls whether exploded deployment content should be automatically deployed",
  245. "name": "AUTO_DEPLOY_EXPLODED",
  246. "value": "false",
  247. "required": false
  248. },
  249. {
  250. "displayName": "Maven mirror URL",
  251. "description": "Maven mirror to use for S2I builds",
  252. "name": "MAVEN_MIRROR_URL",
  253. "value": "",
  254. "required": false
  255. },
  256. {
  257. "displayName": "Maven Additional Arguments",
  258. "description": "Maven additional arguments to use for S2I builds",
  259. "name": "MAVEN_ARGS_APPEND",
  260. "value": "",
  261. "required": false
  262. },
  263. {
  264. "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.",
  265. "name": "ARTIFACT_DIR",
  266. "value": "",
  267. "required": false
  268. },
  269. {
  270. "displayName": "PostgreSQL Image Stream Tag",
  271. "description": "The tag to use for the \"postgresql\" image stream. Typically, this aligns with the major.minor version of PostgreSQL.",
  272. "name": "POSTGRESQL_IMAGE_STREAM_TAG",
  273. "value": "9.5",
  274. "required": true
  275. },
  276. {
  277. "description": "Container memory limit",
  278. "name": "MEMORY_LIMIT",
  279. "value": "1Gi",
  280. "required": false
  281. }
  282. ],
  283. "objects": [
  284. {
  285. "kind": "Service",
  286. "apiVersion": "v1",
  287. "spec": {
  288. "ports": [
  289. {
  290. "port": 8080,
  291. "targetPort": 8080
  292. }
  293. ],
  294. "selector": {
  295. "deploymentConfig": "${APPLICATION_NAME}"
  296. }
  297. },
  298. "metadata": {
  299. "name": "${APPLICATION_NAME}",
  300. "labels": {
  301. "application": "${APPLICATION_NAME}"
  302. },
  303. "annotations": {
  304. "description": "The web server's http port.",
  305. "service.alpha.openshift.io/dependencies": "[{\"name\": \"${APPLICATION_NAME}-postgresql\", \"kind\": \"Service\"}]"
  306. }
  307. }
  308. },
  309. {
  310. "kind": "Service",
  311. "apiVersion": "v1",
  312. "spec": {
  313. "ports": [
  314. {
  315. "port": 8443,
  316. "targetPort": 8443
  317. }
  318. ],
  319. "selector": {
  320. "deploymentConfig": "${APPLICATION_NAME}"
  321. }
  322. },
  323. "metadata": {
  324. "name": "secure-${APPLICATION_NAME}",
  325. "labels": {
  326. "application": "${APPLICATION_NAME}"
  327. },
  328. "annotations": {
  329. "description": "The web server's https port.",
  330. "service.alpha.openshift.io/dependencies": "[{\"name\": \"${APPLICATION_NAME}-postgresql\", \"kind\": \"Service\"}]"
  331. }
  332. }
  333. },
  334. {
  335. "kind": "Service",
  336. "apiVersion": "v1",
  337. "spec": {
  338. "ports": [
  339. {
  340. "port": 5432,
  341. "targetPort": 5432
  342. }
  343. ],
  344. "selector": {
  345. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  346. }
  347. },
  348. "metadata": {
  349. "name": "${APPLICATION_NAME}-postgresql",
  350. "labels": {
  351. "application": "${APPLICATION_NAME}"
  352. },
  353. "annotations": {
  354. "description": "The database server's port."
  355. }
  356. }
  357. },
  358. {
  359. "kind": "Service",
  360. "apiVersion": "v1",
  361. "spec": {
  362. "clusterIP": "None",
  363. "ports": [
  364. {
  365. "name": "ping",
  366. "port": 8888
  367. }
  368. ],
  369. "selector": {
  370. "deploymentConfig": "${APPLICATION_NAME}"
  371. }
  372. },
  373. "metadata": {
  374. "name": "${APPLICATION_NAME}-ping",
  375. "labels": {
  376. "application": "${APPLICATION_NAME}"
  377. },
  378. "annotations": {
  379. "service.alpha.kubernetes.io/tolerate-unready-endpoints": "true",
  380. "description": "The JGroups ping port for clustering."
  381. }
  382. }
  383. },
  384. {
  385. "kind": "Route",
  386. "apiVersion": "v1",
  387. "id": "${APPLICATION_NAME}-http",
  388. "metadata": {
  389. "name": "${APPLICATION_NAME}",
  390. "labels": {
  391. "application": "${APPLICATION_NAME}"
  392. },
  393. "annotations": {
  394. "description": "Route for application's http service."
  395. }
  396. },
  397. "spec": {
  398. "to": {
  399. "name": "${APPLICATION_NAME}"
  400. }
  401. }
  402. },
  403. {
  404. "kind": "Route",
  405. "apiVersion": "v1",
  406. "id": "${APPLICATION_NAME}-https",
  407. "metadata": {
  408. "name": "secure-${APPLICATION_NAME}",
  409. "labels": {
  410. "application": "${APPLICATION_NAME}"
  411. },
  412. "annotations": {
  413. "description": "Route for application's https service."
  414. }
  415. },
  416. "spec": {
  417. "host": "${HOSTNAME_HTTPS}",
  418. "to": {
  419. "name": "secure-${APPLICATION_NAME}"
  420. },
  421. "tls": {
  422. "termination": "passthrough"
  423. }
  424. }
  425. },
  426. {
  427. "kind": "ImageStream",
  428. "apiVersion": "v1",
  429. "metadata": {
  430. "name": "${APPLICATION_NAME}",
  431. "labels": {
  432. "application": "${APPLICATION_NAME}"
  433. }
  434. }
  435. },
  436. {
  437. "kind": "BuildConfig",
  438. "apiVersion": "v1",
  439. "metadata": {
  440. "name": "${APPLICATION_NAME}",
  441. "labels": {
  442. "application": "${APPLICATION_NAME}"
  443. }
  444. },
  445. "spec": {
  446. "source": {
  447. "type": "Git",
  448. "git": {
  449. "uri": "${SOURCE_REPOSITORY_URL}",
  450. "ref": "${SOURCE_REPOSITORY_REF}"
  451. },
  452. "contextDir": "${CONTEXT_DIR}"
  453. },
  454. "strategy": {
  455. "type": "Source",
  456. "sourceStrategy": {
  457. "env": [
  458. {
  459. "name": "MAVEN_MIRROR_URL",
  460. "value": "${MAVEN_MIRROR_URL}"
  461. },
  462. {
  463. "name": "MAVEN_ARGS_APPEND",
  464. "value": "${MAVEN_ARGS_APPEND}"
  465. },
  466. {
  467. "name": "ARTIFACT_DIR",
  468. "value": "${ARTIFACT_DIR}"
  469. }
  470. ],
  471. "forcePull": true,
  472. "from": {
  473. "kind": "ImageStreamTag",
  474. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  475. "name": "eap-cd-openshift:12"
  476. }
  477. }
  478. },
  479. "output": {
  480. "to": {
  481. "kind": "ImageStreamTag",
  482. "name": "${APPLICATION_NAME}:latest"
  483. }
  484. },
  485. "triggers": [
  486. {
  487. "type": "GitHub",
  488. "github": {
  489. "secret": "${GITHUB_WEBHOOK_SECRET}"
  490. }
  491. },
  492. {
  493. "type": "Generic",
  494. "generic": {
  495. "secret": "${GENERIC_WEBHOOK_SECRET}"
  496. }
  497. },
  498. {
  499. "type": "ImageChange",
  500. "imageChange": {}
  501. },
  502. {
  503. "type": "ConfigChange"
  504. }
  505. ]
  506. }
  507. },
  508. {
  509. "kind": "DeploymentConfig",
  510. "apiVersion": "v1",
  511. "metadata": {
  512. "name": "${APPLICATION_NAME}",
  513. "labels": {
  514. "application": "${APPLICATION_NAME}"
  515. }
  516. },
  517. "spec": {
  518. "strategy": {
  519. "type": "Recreate"
  520. },
  521. "triggers": [
  522. {
  523. "type": "ImageChange",
  524. "imageChangeParams": {
  525. "automatic": true,
  526. "containerNames": [
  527. "${APPLICATION_NAME}"
  528. ],
  529. "from": {
  530. "kind": "ImageStreamTag",
  531. "name": "${APPLICATION_NAME}:latest"
  532. }
  533. }
  534. },
  535. {
  536. "type": "ConfigChange"
  537. }
  538. ],
  539. "replicas": 1,
  540. "selector": {
  541. "deploymentConfig": "${APPLICATION_NAME}"
  542. },
  543. "template": {
  544. "metadata": {
  545. "name": "${APPLICATION_NAME}",
  546. "labels": {
  547. "deploymentConfig": "${APPLICATION_NAME}",
  548. "application": "${APPLICATION_NAME}"
  549. }
  550. },
  551. "spec": {
  552. "terminationGracePeriodSeconds": 75,
  553. "containers": [
  554. {
  555. "name": "${APPLICATION_NAME}",
  556. "image": "${APPLICATION_NAME}",
  557. "imagePullPolicy": "Always",
  558. "resources": {
  559. "limits": {
  560. "memory": "${MEMORY_LIMIT}"
  561. }
  562. },
  563. "volumeMounts": [
  564. {
  565. "name": "eap-keystore-volume",
  566. "mountPath": "/etc/eap-secret-volume",
  567. "readOnly": true
  568. },
  569. {
  570. "name": "eap-jgroups-keystore-volume",
  571. "mountPath": "/etc/jgroups-encrypt-secret-volume",
  572. "readOnly": true
  573. }
  574. ],
  575. "livenessProbe": {
  576. "exec": {
  577. "command": [
  578. "/bin/bash",
  579. "-c",
  580. "/opt/eap/bin/livenessProbe.sh"
  581. ]
  582. },
  583. "initialDelaySeconds": 60
  584. },
  585. "readinessProbe": {
  586. "exec": {
  587. "command": [
  588. "/bin/bash",
  589. "-c",
  590. "/opt/eap/bin/readinessProbe.sh"
  591. ]
  592. }
  593. },
  594. "ports": [
  595. {
  596. "name": "jolokia",
  597. "containerPort": 8778,
  598. "protocol": "TCP"
  599. },
  600. {
  601. "name": "http",
  602. "containerPort": 8080,
  603. "protocol": "TCP"
  604. },
  605. {
  606. "name": "https",
  607. "containerPort": 8443,
  608. "protocol": "TCP"
  609. },
  610. {
  611. "name": "ping",
  612. "containerPort": 8888,
  613. "protocol": "TCP"
  614. }
  615. ],
  616. "env": [
  617. {
  618. "name": "DB_SERVICE_PREFIX_MAPPING",
  619. "value": "${APPLICATION_NAME}-postgresql=DB"
  620. },
  621. {
  622. "name": "DB_JNDI",
  623. "value": "${DB_JNDI}"
  624. },
  625. {
  626. "name": "DB_USERNAME",
  627. "value": "${DB_USERNAME}"
  628. },
  629. {
  630. "name": "DB_PASSWORD",
  631. "value": "${DB_PASSWORD}"
  632. },
  633. {
  634. "name": "DB_DATABASE",
  635. "value": "${DB_DATABASE}"
  636. },
  637. {
  638. "name": "TX_DATABASE_PREFIX_MAPPING",
  639. "value": "${APPLICATION_NAME}-postgresql=DB"
  640. },
  641. {
  642. "name": "DB_MIN_POOL_SIZE",
  643. "value": "${DB_MIN_POOL_SIZE}"
  644. },
  645. {
  646. "name": "DB_MAX_POOL_SIZE",
  647. "value": "${DB_MAX_POOL_SIZE}"
  648. },
  649. {
  650. "name": "DB_TX_ISOLATION",
  651. "value": "${DB_TX_ISOLATION}"
  652. },
  653. {
  654. "name": "JGROUPS_PING_PROTOCOL",
  655. "value": "openshift.DNS_PING"
  656. },
  657. {
  658. "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
  659. "value": "${APPLICATION_NAME}-ping"
  660. },
  661. {
  662. "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
  663. "value": "8888"
  664. },
  665. {
  666. "name": "HTTPS_KEYSTORE_DIR",
  667. "value": "/etc/eap-secret-volume"
  668. },
  669. {
  670. "name": "HTTPS_KEYSTORE",
  671. "value": "${HTTPS_KEYSTORE}"
  672. },
  673. {
  674. "name": "HTTPS_KEYSTORE_TYPE",
  675. "value": "${HTTPS_KEYSTORE_TYPE}"
  676. },
  677. {
  678. "name": "HTTPS_NAME",
  679. "value": "${HTTPS_NAME}"
  680. },
  681. {
  682. "name": "HTTPS_PASSWORD",
  683. "value": "${HTTPS_PASSWORD}"
  684. },
  685. {
  686. "name": "MQ_CLUSTER_PASSWORD",
  687. "value": "${MQ_CLUSTER_PASSWORD}"
  688. },
  689. {
  690. "name": "MQ_QUEUES",
  691. "value": "${MQ_QUEUES}"
  692. },
  693. {
  694. "name": "MQ_TOPICS",
  695. "value": "${MQ_TOPICS}"
  696. },
  697. {
  698. "name": "JGROUPS_ENCRYPT_SECRET",
  699. "value": "${JGROUPS_ENCRYPT_SECRET}"
  700. },
  701. {
  702. "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR",
  703. "value": "/etc/jgroups-encrypt-secret-volume"
  704. },
  705. {
  706. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  707. "value": "${JGROUPS_ENCRYPT_KEYSTORE}"
  708. },
  709. {
  710. "name": "JGROUPS_ENCRYPT_NAME",
  711. "value": "${JGROUPS_ENCRYPT_NAME}"
  712. },
  713. {
  714. "name": "JGROUPS_ENCRYPT_PASSWORD",
  715. "value": "${JGROUPS_ENCRYPT_PASSWORD}"
  716. },
  717. {
  718. "name": "JGROUPS_CLUSTER_PASSWORD",
  719. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  720. },
  721. {
  722. "name": "AUTO_DEPLOY_EXPLODED",
  723. "value": "${AUTO_DEPLOY_EXPLODED}"
  724. },
  725. {
  726. "name": "DEFAULT_JOB_REPOSITORY",
  727. "value": "${APPLICATION_NAME}-postgresql"
  728. },
  729. {
  730. "name": "TIMER_SERVICE_DATA_STORE",
  731. "value": "${APPLICATION_NAME}-postgresql"
  732. }
  733. ]
  734. }
  735. ],
  736. "volumes": [
  737. {
  738. "name": "eap-keystore-volume",
  739. "secret": {
  740. "secretName": "${HTTPS_SECRET}"
  741. }
  742. },
  743. {
  744. "name": "eap-jgroups-keystore-volume",
  745. "secret": {
  746. "secretName": "${JGROUPS_ENCRYPT_SECRET}"
  747. }
  748. }
  749. ]
  750. }
  751. }
  752. }
  753. },
  754. {
  755. "kind": "DeploymentConfig",
  756. "apiVersion": "v1",
  757. "metadata": {
  758. "name": "${APPLICATION_NAME}-postgresql",
  759. "labels": {
  760. "application": "${APPLICATION_NAME}"
  761. }
  762. },
  763. "spec": {
  764. "strategy": {
  765. "type": "Recreate"
  766. },
  767. "triggers": [
  768. {
  769. "type": "ImageChange",
  770. "imageChangeParams": {
  771. "automatic": true,
  772. "containerNames": [
  773. "${APPLICATION_NAME}-postgresql"
  774. ],
  775. "from": {
  776. "kind": "ImageStreamTag",
  777. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  778. "name": "postgresql:${POSTGRESQL_IMAGE_STREAM_TAG}"
  779. }
  780. }
  781. },
  782. {
  783. "type": "ConfigChange"
  784. }
  785. ],
  786. "replicas": 1,
  787. "selector": {
  788. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  789. },
  790. "template": {
  791. "metadata": {
  792. "name": "${APPLICATION_NAME}-postgresql",
  793. "labels": {
  794. "deploymentConfig": "${APPLICATION_NAME}-postgresql",
  795. "application": "${APPLICATION_NAME}"
  796. }
  797. },
  798. "spec": {
  799. "terminationGracePeriodSeconds": 60,
  800. "containers": [
  801. {
  802. "name": "${APPLICATION_NAME}-postgresql",
  803. "image": "postgresql",
  804. "imagePullPolicy": "Always",
  805. "ports": [
  806. {
  807. "containerPort": 5432,
  808. "protocol": "TCP"
  809. }
  810. ],
  811. "volumeMounts": [
  812. {
  813. "mountPath": "/var/lib/pgsql/data",
  814. "name": "${APPLICATION_NAME}-postgresql-pvol"
  815. }
  816. ],
  817. "readinessProbe": {
  818. "timeoutSeconds": 1,
  819. "initialDelaySeconds": 5,
  820. "exec": {
  821. "command": [ "/bin/sh", "-i", "-c", "psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1'"]
  822. }
  823. },
  824. "livenessProbe": {
  825. "timeoutSeconds": 1,
  826. "initialDelaySeconds": 30,
  827. "tcpSocket": {
  828. "port": 5432
  829. }
  830. },
  831. "env": [
  832. {
  833. "name": "POSTGRESQL_USER",
  834. "value": "${DB_USERNAME}"
  835. },
  836. {
  837. "name": "POSTGRESQL_PASSWORD",
  838. "value": "${DB_PASSWORD}"
  839. },
  840. {
  841. "name": "POSTGRESQL_DATABASE",
  842. "value": "${DB_DATABASE}"
  843. },
  844. {
  845. "name": "POSTGRESQL_MAX_CONNECTIONS",
  846. "value": "${POSTGRESQL_MAX_CONNECTIONS}"
  847. },
  848. {
  849. "name": "POSTGRESQL_MAX_PREPARED_TRANSACTIONS",
  850. "value": "${POSTGRESQL_MAX_CONNECTIONS}"
  851. },
  852. {
  853. "name": "POSTGRESQL_SHARED_BUFFERS",
  854. "value": "${POSTGRESQL_SHARED_BUFFERS}"
  855. }
  856. ]
  857. }
  858. ],
  859. "volumes": [
  860. {
  861. "name": "${APPLICATION_NAME}-postgresql-pvol",
  862. "persistentVolumeClaim": {
  863. "claimName": "${APPLICATION_NAME}-postgresql-claim"
  864. }
  865. }
  866. ]
  867. }
  868. }
  869. }
  870. },
  871. {
  872. "apiVersion": "v1",
  873. "kind": "PersistentVolumeClaim",
  874. "metadata": {
  875. "name": "${APPLICATION_NAME}-postgresql-claim",
  876. "labels": {
  877. "application": "${APPLICATION_NAME}"
  878. }
  879. },
  880. "spec": {
  881. "accessModes": [
  882. "ReadWriteOnce"
  883. ],
  884. "resources": {
  885. "requests": {
  886. "storage": "${VOLUME_CAPACITY}"
  887. }
  888. }
  889. }
  890. }
  891. ]
  892. }