processserver64-postgresql-s2i.json 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "iconClass": "icon-processserver",
  7. "tags": "processserver,jboss,hidden",
  8. "version": "1.4.8",
  9. "openshift.io/display-name": "JBoss BPM Suite 6.4 intelligent process server + PostgreSQL (Ephemeral with https)",
  10. "openshift.io/provider-display-name": "Red Hat, Inc.",
  11. "description": "An example BPM Suite application with a PostgreSQL database. For more information about using this template, see https://github.com/jboss-openshift/application-templates.",
  12. "template.openshift.io/long-description": "This template defines resources needed to develop Red Hat Business Process Suite intelligent process server 6.4 based application, including a build configuration, application deployment configuration, database deployment configuration for PostgreSQL using ephemeral (temporary) storage and secure communication using https.",
  13. "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-bpm-suite/",
  14. "template.openshift.io/support-url": "https://access.redhat.com"
  15. },
  16. "name": "processserver64-postgresql-s2i"
  17. },
  18. "labels": {
  19. "template": "processserver64-postgresql-s2i",
  20. "xpaas": "1.4.8"
  21. },
  22. "message": "A new BPMS application (using PostgreSQL) has been created in your project. The username/password for accessing the KIE Server REST or JMS interface is ${KIE_SERVER_USER}/${KIE_SERVER_PASSWORD}. For accessing the MySQL database \"${DB_DATABASE}\" use the credentials ${DB_USERNAME}/${DB_PASSWORD}. Please be sure to create the secret named \"${HTTPS_SECRET}\" containing the ${HTTPS_KEYSTORE} file used for serving secure content.",
  23. "parameters": [
  24. {
  25. "displayName": "KIE Container Deployment",
  26. "description": "The KIE Container deployment configuration in format: containerId=groupId:artifactId:version|c2=g2:a2:v2",
  27. "name": "KIE_CONTAINER_DEPLOYMENT",
  28. "value": "processserver-library=org.openshift.quickstarts:processserver-library:1.3.0.Final",
  29. "required": false
  30. },
  31. {
  32. "displayName": "KIE Server Protocol",
  33. "description": "The protocol to access the KIE Server REST interface.",
  34. "name": "KIE_SERVER_PROTOCOL",
  35. "value": "https",
  36. "required": false
  37. },
  38. {
  39. "displayName": "KIE Server Port",
  40. "description": "The port to access the KIE Server REST interface.",
  41. "name": "KIE_SERVER_PORT",
  42. "value": "8443",
  43. "required": false
  44. },
  45. {
  46. "displayName": "KIE Server Username",
  47. "description": "The user name to access the KIE Server REST or JMS interface.",
  48. "name": "KIE_SERVER_USER",
  49. "value": "kieserver",
  50. "required": false
  51. },
  52. {
  53. "displayName": "KIE Server Password",
  54. "description": "The password to access the KIE Server REST or JMS interface. Must be different than username; must not be root, admin, or administrator; must contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), and 1 non-alphanumeric symbol(s).",
  55. "name": "KIE_SERVER_PASSWORD",
  56. "from": "[a-zA-Z]{6}[0-9]{1}!",
  57. "generate": "expression",
  58. "required": false
  59. },
  60. {
  61. "displayName": "KIE Server Domain",
  62. "description": "JAAS LoginContext domain that shall be used to authenticate users when using JMS.",
  63. "name": "KIE_SERVER_DOMAIN",
  64. "value": "other",
  65. "required": false
  66. },
  67. {
  68. "displayName": "KIE Server Persistence Dialect",
  69. "description": "Hibernate persistence dialect.",
  70. "name": "KIE_SERVER_PERSISTENCE_DIALECT",
  71. "value": "org.hibernate.dialect.PostgreSQL82Dialect",
  72. "required": false
  73. },
  74. {
  75. "displayName": "Application Name",
  76. "description": "The name for the application.",
  77. "name": "APPLICATION_NAME",
  78. "value": "kie-app",
  79. "required": true
  80. },
  81. {
  82. "displayName": "Custom http Route Hostname",
  83. "description": "Custom hostname for http service route. Leave blank for default hostname, e.g.: <application-name>-<project>.<default-domain-suffix>",
  84. "name": "HOSTNAME_HTTP",
  85. "value": "",
  86. "required": false
  87. },
  88. {
  89. "displayName": "Custom https Route Hostname",
  90. "description": "Custom hostname for https service route. Leave blank for default hostname, e.g.: secure-<application-name>-<project>.<default-domain-suffix>",
  91. "name": "HOSTNAME_HTTPS",
  92. "value": "",
  93. "required": false
  94. },
  95. {
  96. "displayName": "Git Repository URL",
  97. "description": "Git source URI for application",
  98. "name": "SOURCE_REPOSITORY_URL",
  99. "value": "https://github.com/jboss-openshift/openshift-quickstarts",
  100. "required": true
  101. },
  102. {
  103. "displayName": "Git Reference",
  104. "description": "Git branch/tag reference",
  105. "name": "SOURCE_REPOSITORY_REF",
  106. "value": "1.3",
  107. "required": false
  108. },
  109. {
  110. "displayName": "Context Directory",
  111. "description": "Path within Git project to build; empty for root project directory.",
  112. "name": "CONTEXT_DIR",
  113. "value": "processserver/library",
  114. "required": false
  115. },
  116. {
  117. "displayName": "Database JNDI Name",
  118. "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/ExampleDS",
  119. "name": "DB_JNDI",
  120. "value": "java:jboss/datasources/ExampleDS",
  121. "required": false
  122. },
  123. {
  124. "displayName": "Database Name",
  125. "description": "Database name",
  126. "name": "DB_DATABASE",
  127. "value": "root",
  128. "required": true
  129. },
  130. {
  131. "displayName": "Queues",
  132. "description": "Queue names",
  133. "name": "HORNETQ_QUEUES",
  134. "value": "",
  135. "required": false
  136. },
  137. {
  138. "displayName": "Topics",
  139. "description": "Topic names",
  140. "name": "HORNETQ_TOPICS",
  141. "value": "",
  142. "required": false
  143. },
  144. {
  145. "displayName": "Server Keystore Secret Name",
  146. "description": "The name of the secret containing the keystore file",
  147. "name": "HTTPS_SECRET",
  148. "value": "processserver-app-secret",
  149. "required": false
  150. },
  151. {
  152. "displayName": "Server Keystore Filename",
  153. "description": "The name of the keystore file within the secret",
  154. "name": "HTTPS_KEYSTORE",
  155. "value": "keystore.jks",
  156. "required": false
  157. },
  158. {
  159. "displayName": "Server Certificate Name",
  160. "description": "The name associated with the server certificate",
  161. "name": "HTTPS_NAME",
  162. "value": "jboss",
  163. "required": false
  164. },
  165. {
  166. "displayName": "Server Keystore Password",
  167. "description": "The password for the keystore and certificate",
  168. "name": "HTTPS_PASSWORD",
  169. "value": "mykeystorepass",
  170. "required": false
  171. },
  172. {
  173. "displayName": "Database Username",
  174. "description": "Database user name",
  175. "name": "DB_USERNAME",
  176. "from": "user[a-zA-Z0-9]{3}",
  177. "generate": "expression",
  178. "required": true
  179. },
  180. {
  181. "displayName": "Database Password",
  182. "description": "Database user password",
  183. "name": "DB_PASSWORD",
  184. "from": "[a-zA-Z0-9]{8}",
  185. "generate": "expression",
  186. "required": true
  187. },
  188. {
  189. "displayName": "Datasource Minimum Pool Size",
  190. "description": "Sets xa-pool/min-pool-size for the configured datasource.",
  191. "name": "DB_MIN_POOL_SIZE",
  192. "required": false
  193. },
  194. {
  195. "displayName": "Datasource Maximum Pool Size",
  196. "description": "Sets xa-pool/max-pool-size for the configured datasource.",
  197. "name": "DB_MAX_POOL_SIZE",
  198. "required": false
  199. },
  200. {
  201. "displayName": "Datasource Transaction Isolation",
  202. "description": "Sets transaction-isolation for the configured datasource.",
  203. "name": "DB_TX_ISOLATION",
  204. "required": false
  205. },
  206. {
  207. "displayName": "PostgreSQL Maximum number of connections",
  208. "description": "The maximum number of client connections allowed. This also sets the maximum number of prepared transactions.",
  209. "name": "POSTGRESQL_MAX_CONNECTIONS",
  210. "required": false
  211. },
  212. {
  213. "displayName": "PostgreSQL Shared Buffers",
  214. "description": "Configures how much memory is dedicated to PostgreSQL for caching data.",
  215. "name": "POSTGRESQL_SHARED_BUFFERS",
  216. "required": false
  217. },
  218. {
  219. "displayName": "HornetQ Password",
  220. "description": "HornetQ cluster admin password",
  221. "name": "HORNETQ_CLUSTER_PASSWORD",
  222. "from": "[a-zA-Z0-9]{8}",
  223. "generate": "expression",
  224. "required": true
  225. },
  226. {
  227. "displayName": "Github Webhook Secret",
  228. "description": "GitHub trigger secret",
  229. "name": "GITHUB_WEBHOOK_SECRET",
  230. "from": "[a-zA-Z0-9]{8}",
  231. "generate": "expression",
  232. "required": true
  233. },
  234. {
  235. "displayName": "Generic Webhook Secret",
  236. "description": "Generic build trigger secret",
  237. "name": "GENERIC_WEBHOOK_SECRET",
  238. "from": "[a-zA-Z0-9]{8}",
  239. "generate": "expression",
  240. "required": true
  241. },
  242. {
  243. "displayName": "ImageStream Namespace",
  244. "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.",
  245. "name": "IMAGE_STREAM_NAMESPACE",
  246. "value": "openshift",
  247. "required": true
  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. "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.",
  258. "name": "ARTIFACT_DIR",
  259. "value": "",
  260. "required": false
  261. },
  262. {
  263. "displayName": "PostgreSQL Image Stream Tag",
  264. "description": "The tag to use for the \"postgresql\" image stream. Typically, this aligns with the major.minor version of PostgreSQL.",
  265. "name": "POSTGRESQL_IMAGE_STREAM_TAG",
  266. "value": "9.5",
  267. "required": true
  268. },
  269. {
  270. "description": "Container memory limit",
  271. "name": "MEMORY_LIMIT",
  272. "value": "1Gi",
  273. "required": false
  274. }
  275. ],
  276. "objects": [
  277. {
  278. "kind": "Service",
  279. "apiVersion": "v1",
  280. "spec": {
  281. "ports": [
  282. {
  283. "port": 8080,
  284. "targetPort": 8080
  285. }
  286. ],
  287. "selector": {
  288. "deploymentConfig": "${APPLICATION_NAME}"
  289. }
  290. },
  291. "metadata": {
  292. "name": "${APPLICATION_NAME}",
  293. "labels": {
  294. "application": "${APPLICATION_NAME}"
  295. },
  296. "annotations": {
  297. "description": "The web server's http port.",
  298. "service.alpha.openshift.io/dependencies": "[{\"name\": \"${APPLICATION_NAME}-postgresql\", \"kind\": \"Service\"}]"
  299. }
  300. }
  301. },
  302. {
  303. "kind": "Service",
  304. "apiVersion": "v1",
  305. "spec": {
  306. "ports": [
  307. {
  308. "port": 8443,
  309. "targetPort": 8443
  310. }
  311. ],
  312. "selector": {
  313. "deploymentConfig": "${APPLICATION_NAME}"
  314. }
  315. },
  316. "metadata": {
  317. "name": "secure-${APPLICATION_NAME}",
  318. "labels": {
  319. "application": "${APPLICATION_NAME}"
  320. },
  321. "annotations": {
  322. "description": "The web server's https port.",
  323. "service.alpha.openshift.io/dependencies": "[{\"name\": \"${APPLICATION_NAME}-postgresql\", \"kind\": \"Service\"}]"
  324. }
  325. }
  326. },
  327. {
  328. "kind": "Service",
  329. "apiVersion": "v1",
  330. "spec": {
  331. "ports": [
  332. {
  333. "port": 5432,
  334. "targetPort": 5432
  335. }
  336. ],
  337. "selector": {
  338. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  339. }
  340. },
  341. "metadata": {
  342. "name": "${APPLICATION_NAME}-postgresql",
  343. "labels": {
  344. "application": "${APPLICATION_NAME}"
  345. },
  346. "annotations": {
  347. "description": "The database server's port."
  348. }
  349. }
  350. },
  351. {
  352. "kind": "Route",
  353. "apiVersion": "v1",
  354. "id": "${APPLICATION_NAME}-http",
  355. "metadata": {
  356. "name": "${APPLICATION_NAME}",
  357. "labels": {
  358. "application": "${APPLICATION_NAME}"
  359. },
  360. "annotations": {
  361. "description": "Route for application's http service."
  362. }
  363. },
  364. "spec": {
  365. "host": "${HOSTNAME_HTTP}",
  366. "to": {
  367. "name": "${APPLICATION_NAME}"
  368. }
  369. }
  370. },
  371. {
  372. "kind": "Route",
  373. "apiVersion": "v1",
  374. "id": "${APPLICATION_NAME}-https",
  375. "metadata": {
  376. "name": "secure-${APPLICATION_NAME}",
  377. "labels": {
  378. "application": "${APPLICATION_NAME}"
  379. },
  380. "annotations": {
  381. "description": "Route for application's https service."
  382. }
  383. },
  384. "spec": {
  385. "host": "${HOSTNAME_HTTPS}",
  386. "to": {
  387. "name": "secure-${APPLICATION_NAME}"
  388. },
  389. "tls": {
  390. "termination": "passthrough"
  391. }
  392. }
  393. },
  394. {
  395. "kind": "ImageStream",
  396. "apiVersion": "v1",
  397. "metadata": {
  398. "name": "${APPLICATION_NAME}",
  399. "labels": {
  400. "application": "${APPLICATION_NAME}"
  401. }
  402. }
  403. },
  404. {
  405. "kind": "BuildConfig",
  406. "apiVersion": "v1",
  407. "metadata": {
  408. "name": "${APPLICATION_NAME}",
  409. "labels": {
  410. "application": "${APPLICATION_NAME}"
  411. }
  412. },
  413. "spec": {
  414. "source": {
  415. "type": "Git",
  416. "git": {
  417. "uri": "${SOURCE_REPOSITORY_URL}",
  418. "ref": "${SOURCE_REPOSITORY_REF}"
  419. },
  420. "contextDir": "${CONTEXT_DIR}"
  421. },
  422. "strategy": {
  423. "type": "Source",
  424. "sourceStrategy": {
  425. "env": [
  426. {
  427. "name": "KIE_CONTAINER_DEPLOYMENT",
  428. "value": "${KIE_CONTAINER_DEPLOYMENT}"
  429. },
  430. {
  431. "name": "MAVEN_MIRROR_URL",
  432. "value": "${MAVEN_MIRROR_URL}"
  433. },
  434. {
  435. "name": "ARTIFACT_DIR",
  436. "value": "${ARTIFACT_DIR}"
  437. }
  438. ],
  439. "forcePull": true,
  440. "from": {
  441. "kind": "ImageStreamTag",
  442. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  443. "name": "jboss-processserver64-openshift:1.2"
  444. }
  445. }
  446. },
  447. "output": {
  448. "to": {
  449. "kind": "ImageStreamTag",
  450. "name": "${APPLICATION_NAME}:latest"
  451. }
  452. },
  453. "triggers": [
  454. {
  455. "type": "GitHub",
  456. "github": {
  457. "secret": "${GITHUB_WEBHOOK_SECRET}"
  458. }
  459. },
  460. {
  461. "type": "Generic",
  462. "generic": {
  463. "secret": "${GENERIC_WEBHOOK_SECRET}"
  464. }
  465. },
  466. {
  467. "type": "ImageChange",
  468. "imageChange": {}
  469. },
  470. {
  471. "type": "ConfigChange"
  472. }
  473. ]
  474. }
  475. },
  476. {
  477. "kind": "DeploymentConfig",
  478. "apiVersion": "v1",
  479. "metadata": {
  480. "name": "${APPLICATION_NAME}",
  481. "labels": {
  482. "application": "${APPLICATION_NAME}"
  483. }
  484. },
  485. "spec": {
  486. "strategy": {
  487. "type": "Recreate"
  488. },
  489. "triggers": [
  490. {
  491. "type": "ImageChange",
  492. "imageChangeParams": {
  493. "automatic": true,
  494. "containerNames": [
  495. "${APPLICATION_NAME}"
  496. ],
  497. "from": {
  498. "kind": "ImageStream",
  499. "name": "${APPLICATION_NAME}"
  500. }
  501. }
  502. },
  503. {
  504. "type": "ConfigChange"
  505. }
  506. ],
  507. "replicas": 1,
  508. "selector": {
  509. "deploymentConfig": "${APPLICATION_NAME}"
  510. },
  511. "template": {
  512. "metadata": {
  513. "name": "${APPLICATION_NAME}",
  514. "labels": {
  515. "deploymentConfig": "${APPLICATION_NAME}",
  516. "application": "${APPLICATION_NAME}"
  517. }
  518. },
  519. "spec": {
  520. "terminationGracePeriodSeconds": 60,
  521. "containers": [
  522. {
  523. "name": "${APPLICATION_NAME}",
  524. "image": "${APPLICATION_NAME}",
  525. "imagePullPolicy": "Always",
  526. "resources": {
  527. "limits": {
  528. "memory": "${MEMORY_LIMIT}"
  529. }
  530. },
  531. "volumeMounts": [
  532. {
  533. "name": "processserver-keystore-volume",
  534. "mountPath": "/etc/processserver-secret-volume",
  535. "readOnly": true
  536. }
  537. ],
  538. "livenessProbe": {
  539. "exec": {
  540. "command": [
  541. "/bin/bash",
  542. "-c",
  543. "/opt/eap/bin/livenessProbe.sh"
  544. ]
  545. },
  546. "initialDelaySeconds": 60
  547. },
  548. "readinessProbe": {
  549. "exec": {
  550. "command": [
  551. "/bin/bash",
  552. "-c",
  553. "/opt/eap/bin/readinessProbe.sh"
  554. ]
  555. }
  556. },
  557. "ports": [
  558. {
  559. "name": "jolokia",
  560. "containerPort": 8778,
  561. "protocol": "TCP"
  562. },
  563. {
  564. "name": "http",
  565. "containerPort": 8080,
  566. "protocol": "TCP"
  567. },
  568. {
  569. "name": "https",
  570. "containerPort": 8443,
  571. "protocol": "TCP"
  572. }
  573. ],
  574. "env": [
  575. {
  576. "name": "KIE_CONTAINER_DEPLOYMENT",
  577. "value": "${KIE_CONTAINER_DEPLOYMENT}"
  578. },
  579. {
  580. "name": "KIE_SERVER_PROTOCOL",
  581. "value": "${KIE_SERVER_PROTOCOL}"
  582. },
  583. {
  584. "name": "KIE_SERVER_PORT",
  585. "value": "${KIE_SERVER_PORT}"
  586. },
  587. {
  588. "name": "KIE_SERVER_USER",
  589. "value": "${KIE_SERVER_USER}"
  590. },
  591. {
  592. "name": "KIE_SERVER_PASSWORD",
  593. "value": "${KIE_SERVER_PASSWORD}"
  594. },
  595. {
  596. "name": "KIE_SERVER_DOMAIN",
  597. "value": "${KIE_SERVER_DOMAIN}"
  598. },
  599. {
  600. "name": "KIE_SERVER_PERSISTENCE_DIALECT",
  601. "value": "${KIE_SERVER_PERSISTENCE_DIALECT}"
  602. },
  603. {
  604. "name": "DB_SERVICE_PREFIX_MAPPING",
  605. "value": "${APPLICATION_NAME}-postgresql=DB"
  606. },
  607. {
  608. "name": "DB_JNDI",
  609. "value": "${DB_JNDI}"
  610. },
  611. {
  612. "name": "DB_USERNAME",
  613. "value": "${DB_USERNAME}"
  614. },
  615. {
  616. "name": "DB_PASSWORD",
  617. "value": "${DB_PASSWORD}"
  618. },
  619. {
  620. "name": "DB_DATABASE",
  621. "value": "${DB_DATABASE}"
  622. },
  623. {
  624. "name": "TX_DATABASE_PREFIX_MAPPING",
  625. "value": "${APPLICATION_NAME}-postgresql=DB"
  626. },
  627. {
  628. "name": "DB_MIN_POOL_SIZE",
  629. "value": "${DB_MIN_POOL_SIZE}"
  630. },
  631. {
  632. "name": "DB_MAX_POOL_SIZE",
  633. "value": "${DB_MAX_POOL_SIZE}"
  634. },
  635. {
  636. "name": "DB_TX_ISOLATION",
  637. "value": "${DB_TX_ISOLATION}"
  638. },
  639. {
  640. "name": "HTTPS_KEYSTORE_DIR",
  641. "value": "/etc/processserver-secret-volume"
  642. },
  643. {
  644. "name": "HTTPS_KEYSTORE",
  645. "value": "${HTTPS_KEYSTORE}"
  646. },
  647. {
  648. "name": "HTTPS_NAME",
  649. "value": "${HTTPS_NAME}"
  650. },
  651. {
  652. "name": "HTTPS_PASSWORD",
  653. "value": "${HTTPS_PASSWORD}"
  654. },
  655. {
  656. "name": "HORNETQ_CLUSTER_PASSWORD",
  657. "value": "${HORNETQ_CLUSTER_PASSWORD}"
  658. },
  659. {
  660. "name": "HORNETQ_QUEUES",
  661. "value": "${HORNETQ_QUEUES}"
  662. },
  663. {
  664. "name": "HORNETQ_TOPICS",
  665. "value": "${HORNETQ_TOPICS}"
  666. }
  667. ]
  668. }
  669. ],
  670. "volumes": [
  671. {
  672. "name": "processserver-keystore-volume",
  673. "secret": {
  674. "secretName": "${HTTPS_SECRET}"
  675. }
  676. }
  677. ]
  678. }
  679. }
  680. }
  681. },
  682. {
  683. "kind": "DeploymentConfig",
  684. "apiVersion": "v1",
  685. "metadata": {
  686. "name": "${APPLICATION_NAME}-postgresql",
  687. "labels": {
  688. "application": "${APPLICATION_NAME}"
  689. }
  690. },
  691. "spec": {
  692. "strategy": {
  693. "type": "Recreate"
  694. },
  695. "triggers": [
  696. {
  697. "type": "ImageChange",
  698. "imageChangeParams": {
  699. "automatic": true,
  700. "containerNames": [
  701. "${APPLICATION_NAME}-postgresql"
  702. ],
  703. "from": {
  704. "kind": "ImageStreamTag",
  705. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  706. "name": "postgresql:${POSTGRESQL_IMAGE_STREAM_TAG}"
  707. }
  708. }
  709. },
  710. {
  711. "type": "ConfigChange"
  712. }
  713. ],
  714. "replicas": 1,
  715. "selector": {
  716. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  717. },
  718. "template": {
  719. "metadata": {
  720. "name": "${APPLICATION_NAME}-postgresql",
  721. "labels": {
  722. "deploymentConfig": "${APPLICATION_NAME}-postgresql",
  723. "application": "${APPLICATION_NAME}"
  724. }
  725. },
  726. "spec": {
  727. "terminationGracePeriodSeconds": 60,
  728. "containers": [
  729. {
  730. "name": "${APPLICATION_NAME}-postgresql",
  731. "image": "postgresql",
  732. "imagePullPolicy": "Always",
  733. "ports": [
  734. {
  735. "containerPort": 5432,
  736. "protocol": "TCP"
  737. }
  738. ],
  739. "env": [
  740. {
  741. "name": "POSTGRESQL_USER",
  742. "value": "${DB_USERNAME}"
  743. },
  744. {
  745. "name": "POSTGRESQL_PASSWORD",
  746. "value": "${DB_PASSWORD}"
  747. },
  748. {
  749. "name": "POSTGRESQL_DATABASE",
  750. "value": "${DB_DATABASE}"
  751. },
  752. {
  753. "name": "POSTGRESQL_MAX_CONNECTIONS",
  754. "value": "${POSTGRESQL_MAX_CONNECTIONS}"
  755. },
  756. {
  757. "name": "POSTGRESQL_SHARED_BUFFERS",
  758. "value": "${POSTGRESQL_SHARED_BUFFERS}"
  759. }
  760. ],
  761. "volumeMounts": [
  762. {
  763. "mountPath": "/var/lib/pgsql/data",
  764. "name": "${APPLICATION_NAME}-data"
  765. }
  766. ]
  767. }
  768. ],
  769. "volumes": [
  770. {
  771. "emptyDir": {
  772. "medium": ""
  773. },
  774. "name": "${APPLICATION_NAME}-data"
  775. }
  776. ]
  777. }
  778. }
  779. }
  780. }
  781. ]
  782. }