sso71-postgresql-persistent.json 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for SSO 7.1 PostgreSQL applications with persistent storage",
  7. "iconClass" : "icon-jboss",
  8. "tags" : "sso,keycloak,jboss,xpaas",
  9. "version": "1.0.0",
  10. "openshift.io/display-name": "Red Hat Single Sign-On 7.1 + PostgreSQL (Persistent)"
  11. },
  12. "name": "sso71-postgresql-persistent"
  13. },
  14. "labels": {
  15. "template": "sso71-postgresql-persistent",
  16. "xpaas": "1.4.0"
  17. },
  18. "message": "A new persistent SSO service (using PostgreSQL) has been created in your project. The admin username/password for accessing the master realm via the SSO console is ${SSO_ADMIN_USERNAME}/${SSO_ADMIN_PASSWORD}. The username/password for accessing the PostgreSQL database \"${DB_DATABASE}\" is ${DB_USERNAME}/${DB_PASSWORD}. Please be sure to create the \"${SERVICE_ACCOUNT_NAME}\" service account and 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; \"${SSO_TRUSTSTORE_SECRET}\" containing the ${SSO_TRUSTSTORE} file used for securing SSO requests.",
  19. "parameters": [
  20. {
  21. "displayName": "Application Name",
  22. "description": "The name for the application.",
  23. "name": "APPLICATION_NAME",
  24. "value": "sso",
  25. "required": true
  26. },
  27. {
  28. "displayName": "Custom http Route Hostname",
  29. "description": "Custom hostname for http service route. Leave blank for default hostname, e.g.: <application-name>.<project>.<default-domain-suffix>",
  30. "name": "HOSTNAME_HTTP",
  31. "value": "",
  32. "required": false
  33. },
  34. {
  35. "displayName": "Custom https Route Hostname",
  36. "description": "Custom hostname for https service route. Leave blank for default hostname, e.g.: <application-name>.<project>.<default-domain-suffix>",
  37. "name": "HOSTNAME_HTTPS",
  38. "value": "",
  39. "required": false
  40. },
  41. {
  42. "displayName": "Database JNDI Name",
  43. "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/postgresql",
  44. "name": "DB_JNDI",
  45. "value": "java:jboss/datasources/KeycloakDS",
  46. "required": false
  47. },
  48. {
  49. "displayName": "Database Name",
  50. "description": "Database name",
  51. "name": "DB_DATABASE",
  52. "value": "root",
  53. "required": true
  54. },
  55. {
  56. "displayName": "Service Account Name",
  57. "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.",
  58. "name": "SERVICE_ACCOUNT_NAME",
  59. "value": "sso-service-account",
  60. "required": true
  61. },
  62. {
  63. "displayName": "Server Keystore Secret Name",
  64. "description": "The name of the secret containing the keystore file",
  65. "name": "HTTPS_SECRET",
  66. "value": "sso-app-secret",
  67. "required": false
  68. },
  69. {
  70. "displayName": "Server Keystore Filename",
  71. "description": "The name of the keystore file within the secret",
  72. "name": "HTTPS_KEYSTORE",
  73. "value": "keystore.jks",
  74. "required": false
  75. },
  76. {
  77. "displayName": "Server Keystore Type",
  78. "description": "The type of the keystore file (JKS or JCEKS)",
  79. "name": "HTTPS_KEYSTORE_TYPE",
  80. "value": "",
  81. "required": false
  82. },
  83. {
  84. "displayName": "Server Certificate Name",
  85. "description": "The name associated with the server certificate (e.g. jboss)",
  86. "name": "HTTPS_NAME",
  87. "value": "",
  88. "required": false
  89. },
  90. {
  91. "displayName": "Server Keystore Password",
  92. "description": "The password for the keystore and certificate (e.g. mykeystorepass)",
  93. "name": "HTTPS_PASSWORD",
  94. "value": "",
  95. "required": false
  96. },
  97. {
  98. "displayName": "Datasource Minimum Pool Size",
  99. "description": "Sets xa-pool/min-pool-size for the configured datasource.",
  100. "name": "DB_MIN_POOL_SIZE",
  101. "required": false
  102. },
  103. {
  104. "displayName": "Datasource Maximum Pool Size",
  105. "description": "Sets xa-pool/max-pool-size for the configured datasource.",
  106. "name": "DB_MAX_POOL_SIZE",
  107. "required": false
  108. },
  109. {
  110. "displayName": "Datasource Transaction Isolation",
  111. "description": "Sets transaction-isolation for the configured datasource.",
  112. "name": "DB_TX_ISOLATION",
  113. "required": false
  114. },
  115. {
  116. "displayName": "PostgreSQL Maximum number of connections",
  117. "description": "The maximum number of client connections allowed. This also sets the maximum number of prepared transactions.",
  118. "name": "POSTGRESQL_MAX_CONNECTIONS",
  119. "required": false
  120. },
  121. {
  122. "displayName": "PostgreSQL Shared Buffers",
  123. "description": "Configures how much memory is dedicated to PostgreSQL for caching data.",
  124. "name": "POSTGRESQL_SHARED_BUFFERS",
  125. "required": false
  126. },
  127. {
  128. "displayName": "Database Username",
  129. "description": "Database user name",
  130. "name": "DB_USERNAME",
  131. "from": "user[a-zA-Z0-9]{3}",
  132. "generate": "expression",
  133. "required": true
  134. },
  135. {
  136. "displayName": "Database Password",
  137. "description": "Database user password",
  138. "name": "DB_PASSWORD",
  139. "from": "[a-zA-Z0-9]{8}",
  140. "generate": "expression",
  141. "required": true
  142. },
  143. {
  144. "displayName": "Database Volume Capacity",
  145. "description": "Size of persistent storage for database volume.",
  146. "name": "VOLUME_CAPACITY",
  147. "value": "512Mi",
  148. "required": true
  149. },
  150. {
  151. "displayName": "JGroups Secret Name",
  152. "description": "The name of the secret containing the keystore file",
  153. "name": "JGROUPS_ENCRYPT_SECRET",
  154. "value": "sso-app-secret",
  155. "required": false
  156. },
  157. {
  158. "displayName": "JGroups Keystore Filename",
  159. "description": "The name of the keystore file within the secret",
  160. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  161. "value": "jgroups.jceks",
  162. "required": false
  163. },
  164. {
  165. "displayName": "JGroups Certificate Name",
  166. "description": "The name associated with the server certificate (e.g. secret-key)",
  167. "name": "JGROUPS_ENCRYPT_NAME",
  168. "value": "",
  169. "required": false
  170. },
  171. {
  172. "displayName": "JGroups Keystore Password",
  173. "description": "The password for the keystore and certificate (e.g. password)",
  174. "name": "JGROUPS_ENCRYPT_PASSWORD",
  175. "value": "",
  176. "required": false
  177. },
  178. {
  179. "displayName": "JGroups Cluster Password",
  180. "description": "JGroups cluster password",
  181. "name": "JGROUPS_CLUSTER_PASSWORD",
  182. "from": "[a-zA-Z0-9]{8}",
  183. "generate": "expression",
  184. "required": true
  185. },
  186. {
  187. "displayName": "ImageStream Namespace",
  188. "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.",
  189. "name": "IMAGE_STREAM_NAMESPACE",
  190. "value": "openshift",
  191. "required": true
  192. },
  193. {
  194. "displayName": "SSO Admin Username",
  195. "description": "SSO Server admin username",
  196. "name": "SSO_ADMIN_USERNAME",
  197. "from": "[a-zA-Z0-9]{8}",
  198. "generate": "expression",
  199. "required": true
  200. },
  201. {
  202. "displayName": "SSO Admin Password",
  203. "description": "SSO Server admin password",
  204. "name": "SSO_ADMIN_PASSWORD",
  205. "from": "[a-zA-Z0-9]{8}",
  206. "generate": "expression",
  207. "required": true
  208. },
  209. {
  210. "displayName": "SSO Realm",
  211. "description": "Realm to be created in the SSO server (e.g. demo).",
  212. "name": "SSO_REALM",
  213. "value": "",
  214. "required": false
  215. },
  216. {
  217. "displayName": "SSO Service Username",
  218. "description": "The username used to access the SSO service. This is used by clients to create the appliction client(s) within the specified SSO realm.",
  219. "name": "SSO_SERVICE_USERNAME",
  220. "value": "",
  221. "required": false
  222. },
  223. {
  224. "displayName": "SSO Service Password",
  225. "description": "The password for the SSO service user.",
  226. "name": "SSO_SERVICE_PASSWORD",
  227. "value": "",
  228. "required": false
  229. },
  230. {
  231. "displayName": "SSO Trust Store",
  232. "description": "The name of the truststore file within the secret (e.g. truststore.jks)",
  233. "name": "SSO_TRUSTSTORE",
  234. "value": "",
  235. "required": false
  236. },
  237. {
  238. "displayName": "SSO Trust Store Password",
  239. "description": "The password for the truststore and certificate (e.g. mykeystorepass)",
  240. "name": "SSO_TRUSTSTORE_PASSWORD",
  241. "value": "",
  242. "required": false
  243. },
  244. {
  245. "displayName": "SSO Trust Store Secret",
  246. "description": "The name of the secret containing the truststore file (e.g. truststore-secret). Used for volume secretName",
  247. "name": "SSO_TRUSTSTORE_SECRET",
  248. "value": "sso-app-secret",
  249. "required": false
  250. },
  251. {
  252. "displayName": "PostgreSQL Image Stream Tag",
  253. "description": "The tag to use for the \"postgresql\" image stream. Typically, this aligns with the major.minor version of PostgreSQL.",
  254. "name": "POSTGRESQL_IMAGE_STREAM_TAG",
  255. "value": "9.5",
  256. "required": true
  257. }
  258. ],
  259. "objects": [
  260. {
  261. "kind": "Service",
  262. "apiVersion": "v1",
  263. "spec": {
  264. "ports": [
  265. {
  266. "port": 8080,
  267. "targetPort": 8080
  268. }
  269. ],
  270. "selector": {
  271. "deploymentConfig": "${APPLICATION_NAME}"
  272. }
  273. },
  274. "metadata": {
  275. "name": "${APPLICATION_NAME}",
  276. "labels": {
  277. "application": "${APPLICATION_NAME}"
  278. },
  279. "annotations": {
  280. "description": "The web server's http port.",
  281. "service.alpha.openshift.io/dependencies": "[{\"name\": \"${APPLICATION_NAME}-postgresql\", \"kind\": \"Service\"}]"
  282. }
  283. }
  284. },
  285. {
  286. "kind": "Service",
  287. "apiVersion": "v1",
  288. "spec": {
  289. "ports": [
  290. {
  291. "port": 8443,
  292. "targetPort": 8443
  293. }
  294. ],
  295. "selector": {
  296. "deploymentConfig": "${APPLICATION_NAME}"
  297. }
  298. },
  299. "metadata": {
  300. "name": "secure-${APPLICATION_NAME}",
  301. "labels": {
  302. "application": "${APPLICATION_NAME}"
  303. },
  304. "annotations": {
  305. "description": "The web server's https port.",
  306. "service.alpha.openshift.io/dependencies": "[{\"name\": \"${APPLICATION_NAME}-postgresql\", \"kind\": \"Service\"}]"
  307. }
  308. }
  309. },
  310. {
  311. "kind": "Service",
  312. "apiVersion": "v1",
  313. "spec": {
  314. "ports": [
  315. {
  316. "port": 5432,
  317. "targetPort": 5432
  318. }
  319. ],
  320. "selector": {
  321. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  322. }
  323. },
  324. "metadata": {
  325. "name": "${APPLICATION_NAME}-postgresql",
  326. "labels": {
  327. "application": "${APPLICATION_NAME}"
  328. },
  329. "annotations": {
  330. "description": "The database server's port."
  331. }
  332. }
  333. },
  334. {
  335. "kind": "Route",
  336. "apiVersion": "v1",
  337. "id": "${APPLICATION_NAME}-http",
  338. "metadata": {
  339. "name": "${APPLICATION_NAME}",
  340. "labels": {
  341. "application": "${APPLICATION_NAME}"
  342. },
  343. "annotations": {
  344. "description": "Route for application's http service."
  345. }
  346. },
  347. "spec": {
  348. "host": "${HOSTNAME_HTTP}",
  349. "to": {
  350. "name": "${APPLICATION_NAME}"
  351. }
  352. }
  353. },
  354. {
  355. "kind": "Route",
  356. "apiVersion": "v1",
  357. "id": "${APPLICATION_NAME}-https",
  358. "metadata": {
  359. "name": "secure-${APPLICATION_NAME}",
  360. "labels": {
  361. "application": "${APPLICATION_NAME}"
  362. },
  363. "annotations": {
  364. "description": "Route for application's https service."
  365. }
  366. },
  367. "spec": {
  368. "host": "${HOSTNAME_HTTPS}",
  369. "to": {
  370. "name": "secure-${APPLICATION_NAME}"
  371. },
  372. "tls": {
  373. "termination": "passthrough"
  374. }
  375. }
  376. },
  377. {
  378. "kind": "DeploymentConfig",
  379. "apiVersion": "v1",
  380. "metadata": {
  381. "name": "${APPLICATION_NAME}",
  382. "labels": {
  383. "application": "${APPLICATION_NAME}"
  384. }
  385. },
  386. "spec": {
  387. "strategy": {
  388. "type": "Recreate"
  389. },
  390. "triggers": [
  391. {
  392. "type": "ImageChange",
  393. "imageChangeParams": {
  394. "automatic": true,
  395. "containerNames": [
  396. "${APPLICATION_NAME}"
  397. ],
  398. "from": {
  399. "kind": "ImageStreamTag",
  400. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  401. "name": "redhat-sso71-openshift:1.1"
  402. }
  403. }
  404. },
  405. {
  406. "type": "ConfigChange"
  407. }
  408. ],
  409. "replicas": 1,
  410. "selector": {
  411. "deploymentConfig": "${APPLICATION_NAME}"
  412. },
  413. "template": {
  414. "metadata": {
  415. "name": "${APPLICATION_NAME}",
  416. "labels": {
  417. "deploymentConfig": "${APPLICATION_NAME}",
  418. "application": "${APPLICATION_NAME}"
  419. }
  420. },
  421. "spec": {
  422. "serviceAccountName": "${SERVICE_ACCOUNT_NAME}",
  423. "terminationGracePeriodSeconds": 75,
  424. "containers": [
  425. {
  426. "name": "${APPLICATION_NAME}",
  427. "image": "${APPLICATION_NAME}",
  428. "imagePullPolicy": "Always",
  429. "volumeMounts": [
  430. {
  431. "name": "eap-keystore-volume",
  432. "mountPath": "/etc/eap-secret-volume",
  433. "readOnly": true
  434. },
  435. {
  436. "name": "eap-jgroups-keystore-volume",
  437. "mountPath": "/etc/jgroups-encrypt-secret-volume",
  438. "readOnly": true
  439. },
  440. {
  441. "name": "sso-truststore-volume",
  442. "mountPath": "/etc/sso-secret-volume",
  443. "readOnly": true
  444. }
  445. ],
  446. "lifecycle": {
  447. "preStop": {
  448. "exec": {
  449. "command": [
  450. "/opt/eap/bin/jboss-cli.sh",
  451. "-c",
  452. ":shutdown(timeout=60)"
  453. ]
  454. }
  455. }
  456. },
  457. "livenessProbe": {
  458. "exec": {
  459. "command": [
  460. "/bin/bash",
  461. "-c",
  462. "/opt/eap/bin/livenessProbe.sh"
  463. ]
  464. }
  465. },
  466. "readinessProbe": {
  467. "exec": {
  468. "command": [
  469. "/bin/bash",
  470. "-c",
  471. "/opt/eap/bin/readinessProbe.sh"
  472. ]
  473. }
  474. },
  475. "ports": [
  476. {
  477. "name": "jolokia",
  478. "containerPort": 8778,
  479. "protocol": "TCP"
  480. },
  481. {
  482. "name": "http",
  483. "containerPort": 8080,
  484. "protocol": "TCP"
  485. },
  486. {
  487. "name": "https",
  488. "containerPort": 8443,
  489. "protocol": "TCP"
  490. },
  491. {
  492. "name": "ping",
  493. "containerPort": 8888,
  494. "protocol": "TCP"
  495. }
  496. ],
  497. "env": [
  498. {
  499. "name": "DB_SERVICE_PREFIX_MAPPING",
  500. "value": "${APPLICATION_NAME}-postgresql=DB"
  501. },
  502. {
  503. "name": "DB_JNDI",
  504. "value": "${DB_JNDI}"
  505. },
  506. {
  507. "name": "DB_USERNAME",
  508. "value": "${DB_USERNAME}"
  509. },
  510. {
  511. "name": "DB_PASSWORD",
  512. "value": "${DB_PASSWORD}"
  513. },
  514. {
  515. "name": "DB_DATABASE",
  516. "value": "${DB_DATABASE}"
  517. },
  518. {
  519. "name": "TX_DATABASE_PREFIX_MAPPING",
  520. "value": "${APPLICATION_NAME}-postgresql=DB"
  521. },
  522. {
  523. "name": "DB_MIN_POOL_SIZE",
  524. "value": "${DB_MIN_POOL_SIZE}"
  525. },
  526. {
  527. "name": "DB_MAX_POOL_SIZE",
  528. "value": "${DB_MAX_POOL_SIZE}"
  529. },
  530. {
  531. "name": "DB_TX_ISOLATION",
  532. "value": "${DB_TX_ISOLATION}"
  533. },
  534. {
  535. "name": "OPENSHIFT_KUBE_PING_LABELS",
  536. "value": "application=${APPLICATION_NAME}"
  537. },
  538. {
  539. "name": "OPENSHIFT_KUBE_PING_NAMESPACE",
  540. "valueFrom": {
  541. "fieldRef": {
  542. "fieldPath": "metadata.namespace"
  543. }
  544. }
  545. },
  546. {
  547. "name": "HTTPS_KEYSTORE_DIR",
  548. "value": "/etc/eap-secret-volume"
  549. },
  550. {
  551. "name": "HTTPS_KEYSTORE",
  552. "value": "${HTTPS_KEYSTORE}"
  553. },
  554. {
  555. "name": "HTTPS_KEYSTORE_TYPE",
  556. "value": "${HTTPS_KEYSTORE_TYPE}"
  557. },
  558. {
  559. "name": "HTTPS_NAME",
  560. "value": "${HTTPS_NAME}"
  561. },
  562. {
  563. "name": "HTTPS_PASSWORD",
  564. "value": "${HTTPS_PASSWORD}"
  565. },
  566. {
  567. "name": "JGROUPS_ENCRYPT_SECRET",
  568. "value": "${JGROUPS_ENCRYPT_SECRET}"
  569. },
  570. {
  571. "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR",
  572. "value": "/etc/jgroups-encrypt-secret-volume"
  573. },
  574. {
  575. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  576. "value": "${JGROUPS_ENCRYPT_KEYSTORE}"
  577. },
  578. {
  579. "name": "JGROUPS_ENCRYPT_NAME",
  580. "value": "${JGROUPS_ENCRYPT_NAME}"
  581. },
  582. {
  583. "name": "JGROUPS_ENCRYPT_PASSWORD",
  584. "value": "${JGROUPS_ENCRYPT_PASSWORD}"
  585. },
  586. {
  587. "name": "JGROUPS_CLUSTER_PASSWORD",
  588. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  589. },
  590. {
  591. "name": "SSO_ADMIN_USERNAME",
  592. "value": "${SSO_ADMIN_USERNAME}"
  593. },
  594. {
  595. "name": "SSO_ADMIN_PASSWORD",
  596. "value": "${SSO_ADMIN_PASSWORD}"
  597. },
  598. {
  599. "name": "SSO_REALM",
  600. "value": "${SSO_REALM}"
  601. },
  602. {
  603. "name": "SSO_SERVICE_USERNAME",
  604. "value": "${SSO_SERVICE_USERNAME}"
  605. },
  606. {
  607. "name": "SSO_SERVICE_PASSWORD",
  608. "value": "${SSO_SERVICE_PASSWORD}"
  609. },
  610. {
  611. "name": "SSO_TRUSTSTORE",
  612. "value": "${SSO_TRUSTSTORE}"
  613. },
  614. {
  615. "name": "SSO_TRUSTSTORE_DIR",
  616. "value": "/etc/sso-secret-volume"
  617. },
  618. {
  619. "name": "SSO_TRUSTSTORE_PASSWORD",
  620. "value": "${SSO_TRUSTSTORE_PASSWORD}"
  621. }
  622. ]
  623. }
  624. ],
  625. "volumes": [
  626. {
  627. "name": "eap-keystore-volume",
  628. "secret": {
  629. "secretName": "${HTTPS_SECRET}"
  630. }
  631. },
  632. {
  633. "name": "eap-jgroups-keystore-volume",
  634. "secret": {
  635. "secretName": "${JGROUPS_ENCRYPT_SECRET}"
  636. }
  637. },
  638. {
  639. "name": "sso-truststore-volume",
  640. "secret": {
  641. "secretName": "${SSO_TRUSTSTORE_SECRET}"
  642. }
  643. }
  644. ]
  645. }
  646. }
  647. }
  648. },
  649. {
  650. "kind": "DeploymentConfig",
  651. "apiVersion": "v1",
  652. "metadata": {
  653. "name": "${APPLICATION_NAME}-postgresql",
  654. "labels": {
  655. "application": "${APPLICATION_NAME}"
  656. }
  657. },
  658. "spec": {
  659. "strategy": {
  660. "type": "Recreate"
  661. },
  662. "triggers": [
  663. {
  664. "type": "ImageChange",
  665. "imageChangeParams": {
  666. "automatic": true,
  667. "containerNames": [
  668. "${APPLICATION_NAME}-postgresql"
  669. ],
  670. "from": {
  671. "kind": "ImageStreamTag",
  672. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  673. "name": "postgresql:${POSTGRESQL_IMAGE_STREAM_TAG}"
  674. }
  675. }
  676. },
  677. {
  678. "type": "ConfigChange"
  679. }
  680. ],
  681. "replicas": 1,
  682. "selector": {
  683. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  684. },
  685. "template": {
  686. "metadata": {
  687. "name": "${APPLICATION_NAME}-postgresql",
  688. "labels": {
  689. "deploymentConfig": "${APPLICATION_NAME}-postgresql",
  690. "application": "${APPLICATION_NAME}"
  691. }
  692. },
  693. "spec": {
  694. "terminationGracePeriodSeconds": 60,
  695. "containers": [
  696. {
  697. "name": "${APPLICATION_NAME}-postgresql",
  698. "image": "postgresql",
  699. "imagePullPolicy": "Always",
  700. "ports": [
  701. {
  702. "containerPort": 5432,
  703. "protocol": "TCP"
  704. }
  705. ],
  706. "volumeMounts": [
  707. {
  708. "mountPath": "/var/lib/pgsql/data",
  709. "name": "${APPLICATION_NAME}-postgresql-pvol"
  710. }
  711. ],
  712. "env": [
  713. {
  714. "name": "POSTGRESQL_USER",
  715. "value": "${DB_USERNAME}"
  716. },
  717. {
  718. "name": "POSTGRESQL_PASSWORD",
  719. "value": "${DB_PASSWORD}"
  720. },
  721. {
  722. "name": "POSTGRESQL_DATABASE",
  723. "value": "${DB_DATABASE}"
  724. },
  725. {
  726. "name": "POSTGRESQL_MAX_CONNECTIONS",
  727. "value": "${POSTGRESQL_MAX_CONNECTIONS}"
  728. },
  729. {
  730. "name": "POSTGRESQL_MAX_PREPARED_TRANSACTIONS",
  731. "value": "${POSTGRESQL_MAX_CONNECTIONS}"
  732. },
  733. {
  734. "name": "POSTGRESQL_SHARED_BUFFERS",
  735. "value": "${POSTGRESQL_SHARED_BUFFERS}"
  736. }
  737. ]
  738. }
  739. ],
  740. "volumes": [
  741. {
  742. "name": "${APPLICATION_NAME}-postgresql-pvol",
  743. "persistentVolumeClaim": {
  744. "claimName": "${APPLICATION_NAME}-postgresql-claim"
  745. }
  746. }
  747. ]
  748. }
  749. }
  750. }
  751. },
  752. {
  753. "apiVersion": "v1",
  754. "kind": "PersistentVolumeClaim",
  755. "metadata": {
  756. "name": "${APPLICATION_NAME}-postgresql-claim",
  757. "labels": {
  758. "application": "${APPLICATION_NAME}"
  759. }
  760. },
  761. "spec": {
  762. "accessModes": [
  763. "ReadWriteOnce"
  764. ],
  765. "resources": {
  766. "requests": {
  767. "storage": "${VOLUME_CAPACITY}"
  768. }
  769. }
  770. }
  771. }
  772. ]
  773. }