eap6-postgresql-persistent-sti.json 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for EAP 6 PostgreSQL applications with persistent storage built using STI.",
  7. "iconClass" : "icon-jboss"
  8. },
  9. "name": "eap6-postgresql-persistent-sti"
  10. },
  11. "labels": {
  12. "template": "eap6-postgresql-persistent-sti"
  13. },
  14. "parameters": [
  15. {
  16. "description": "EAP Release version, e.g. 6.4, etc.",
  17. "name": "EAP_RELEASE",
  18. "value": "6.4"
  19. },
  20. {
  21. "description": "The name for the application.",
  22. "name": "APPLICATION_NAME",
  23. "value": "eap-app"
  24. },
  25. {
  26. "description": "Custom hostname for service routes. Leave blank for default hostname, e.g.: <application-name>.<project>.<default-domain-suffix>",
  27. "name": "APPLICATION_HOSTNAME",
  28. "value": ""
  29. },
  30. {
  31. "description": "Git source URI for application",
  32. "name": "GIT_URI"
  33. },
  34. {
  35. "description": "Git branch/tag reference",
  36. "name": "GIT_REF",
  37. "value": "master"
  38. },
  39. {
  40. "description": "Path within Git project to build; empty for root project directory.",
  41. "name": "GIT_CONTEXT_DIR",
  42. "value": ""
  43. },
  44. {
  45. "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/postgresql",
  46. "name": "DB_JNDI",
  47. "value": ""
  48. },
  49. {
  50. "description": "Database name",
  51. "name": "DB_DATABASE",
  52. "value": "root"
  53. },
  54. {
  55. "description": "Size of persistent storage for database volume.",
  56. "name": "VOLUME_CAPACITY",
  57. "value": "512Mi"
  58. },
  59. {
  60. "description": "Queue names",
  61. "name": "HORNETQ_QUEUES",
  62. "value": ""
  63. },
  64. {
  65. "description": "Topic names",
  66. "name": "HORNETQ_TOPICS",
  67. "value": ""
  68. },
  69. {
  70. "description": "The name of the secret containing the keystore file",
  71. "name": "EAP_HTTPS_SECRET",
  72. "value": "eap-app-secret"
  73. },
  74. {
  75. "description": "The name of the keystore file within the secret",
  76. "name": "EAP_HTTPS_KEYSTORE",
  77. "value": "keystore.jks"
  78. },
  79. {
  80. "description": "The name associated with the server certificate",
  81. "name": "EAP_HTTPS_NAME",
  82. "value": ""
  83. },
  84. {
  85. "description": "The password for the keystore and certificate",
  86. "name": "EAP_HTTPS_PASSWORD",
  87. "value": ""
  88. },
  89. {
  90. "description": "Sets xa-pool/min-pool-size for the configured datasource.",
  91. "name": "DB_MIN_POOL_SIZE"
  92. },
  93. {
  94. "description": "Sets xa-pool/max-pool-size for the configured datasource.",
  95. "name": "DB_MAX_POOL_SIZE"
  96. },
  97. {
  98. "description": "Sets transaction-isolation for the configured datasource.",
  99. "name": "DB_TX_ISOLATION"
  100. },
  101. {
  102. "description": "The maximum number of client connections allowed. This also sets the maximum number of prepared transactions.",
  103. "name": "POSTGRESQL_MAX_CONNECTIONS"
  104. },
  105. {
  106. "description": "Configures how much memory is dedicated to PostgreSQL for caching data.",
  107. "name": "POSTGRESQL_SHARED_BUFFERS"
  108. },
  109. {
  110. "description": "HornetQ cluster admin password",
  111. "name": "HORNETQ_CLUSTER_PASSWORD",
  112. "from": "[a-zA-Z0-9]{8}",
  113. "generate": "expression"
  114. },
  115. {
  116. "description": "Database user name",
  117. "name": "DB_USERNAME",
  118. "from": "user[a-zA-Z0-9]{3}",
  119. "generate": "expression"
  120. },
  121. {
  122. "description": "Database user password",
  123. "name": "DB_PASSWORD",
  124. "from": "[a-zA-Z0-9]{8}",
  125. "generate": "expression"
  126. },
  127. {
  128. "description": "Github trigger secret",
  129. "name": "GITHUB_TRIGGER_SECRET",
  130. "from": "[a-zA-Z0-9]{8}",
  131. "generate": "expression"
  132. },
  133. {
  134. "description": "Generic build trigger secret",
  135. "name": "GENERIC_TRIGGER_SECRET",
  136. "from": "[a-zA-Z0-9]{8}",
  137. "generate": "expression"
  138. }
  139. ],
  140. "objects": [
  141. {
  142. "kind": "Service",
  143. "apiVersion": "v1",
  144. "spec": {
  145. "ports": [
  146. {
  147. "port": 8080,
  148. "targetPort": 8080
  149. }
  150. ],
  151. "selector": {
  152. "deploymentConfig": "${APPLICATION_NAME}"
  153. }
  154. },
  155. "metadata": {
  156. "name": "${APPLICATION_NAME}",
  157. "labels": {
  158. "application": "${APPLICATION_NAME}"
  159. },
  160. "annotations": {
  161. "description": "The web server's http port."
  162. }
  163. }
  164. },
  165. {
  166. "kind": "Service",
  167. "apiVersion": "v1",
  168. "spec": {
  169. "ports": [
  170. {
  171. "port": 8443,
  172. "targetPort": 8443
  173. }
  174. ],
  175. "selector": {
  176. "deploymentConfig": "${APPLICATION_NAME}"
  177. }
  178. },
  179. "metadata": {
  180. "name": "secure-${APPLICATION_NAME}",
  181. "labels": {
  182. "application": "${APPLICATION_NAME}"
  183. },
  184. "annotations": {
  185. "description": "The web server's https port."
  186. }
  187. }
  188. },
  189. {
  190. "kind": "Service",
  191. "apiVersion": "v1",
  192. "spec": {
  193. "ports": [
  194. {
  195. "port": 8888,
  196. "targetPort": 8888
  197. }
  198. ],
  199. "portalIP": "None",
  200. "selector": {
  201. "deploymentConfig": "${APPLICATION_NAME}"
  202. }
  203. },
  204. "metadata": {
  205. "name": "${APPLICATION_NAME}-ping",
  206. "labels": {
  207. "application": "${APPLICATION_NAME}"
  208. },
  209. "annotations": {
  210. "description": "Ping service for clustered applications."
  211. }
  212. }
  213. },
  214. {
  215. "kind": "Service",
  216. "apiVersion": "v1",
  217. "spec": {
  218. "ports": [
  219. {
  220. "port": 5432,
  221. "targetPort": 5432
  222. }
  223. ],
  224. "selector": {
  225. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  226. }
  227. },
  228. "metadata": {
  229. "name": "${APPLICATION_NAME}-postgresql",
  230. "labels": {
  231. "application": "${APPLICATION_NAME}"
  232. },
  233. "annotations": {
  234. "description": "The database server's port."
  235. }
  236. }
  237. },
  238. {
  239. "kind": "Route",
  240. "apiVersion": "v1",
  241. "id": "${APPLICATION_NAME}-http-route",
  242. "metadata": {
  243. "name": "${APPLICATION_NAME}-http-route",
  244. "labels": {
  245. "application": "${APPLICATION_NAME}"
  246. },
  247. "annotations": {
  248. "description": "Route for application's http service."
  249. }
  250. },
  251. "spec": {
  252. "host": "${APPLICATION_HOSTNAME}",
  253. "to": {
  254. "name": "${APPLICATION_NAME}"
  255. }
  256. }
  257. },
  258. {
  259. "kind": "Route",
  260. "apiVersion": "v1",
  261. "id": "${APPLICATION_NAME}-https-route",
  262. "metadata": {
  263. "name": "${APPLICATION_NAME}-https-route",
  264. "labels": {
  265. "application": "${APPLICATION_NAME}"
  266. },
  267. "annotations": {
  268. "description": "Route for application's https service."
  269. }
  270. },
  271. "spec": {
  272. "host": "${APPLICATION_HOSTNAME}",
  273. "to": {
  274. "name": "secure-${APPLICATION_NAME}"
  275. },
  276. "tls": {
  277. "termination" : "passthrough"
  278. }
  279. }
  280. },
  281. {
  282. "kind": "ImageStream",
  283. "apiVersion": "v1",
  284. "metadata": {
  285. "name": "${APPLICATION_NAME}",
  286. "labels": {
  287. "application": "${APPLICATION_NAME}"
  288. }
  289. }
  290. },
  291. {
  292. "kind": "BuildConfig",
  293. "apiVersion": "v1",
  294. "metadata": {
  295. "name": "${APPLICATION_NAME}",
  296. "labels": {
  297. "application": "${APPLICATION_NAME}"
  298. }
  299. },
  300. "spec": {
  301. "source": {
  302. "type": "Git",
  303. "git": {
  304. "uri": "${GIT_URI}",
  305. "ref": "${GIT_REF}"
  306. },
  307. "contextDir":"${GIT_CONTEXT_DIR}"
  308. },
  309. "strategy": {
  310. "type": "Source",
  311. "sourceStrategy": {
  312. "from": {
  313. "kind": "ImageStreamTag",
  314. "namespace": "openshift",
  315. "name": "jboss-eap6-openshift:${EAP_RELEASE}"
  316. }
  317. }
  318. },
  319. "output": {
  320. "to": {
  321. "name": "${APPLICATION_NAME}"
  322. }
  323. },
  324. "triggers": [
  325. {
  326. "type": "github",
  327. "github": {
  328. "secret": "${GITHUB_TRIGGER_SECRET}"
  329. }
  330. },
  331. {
  332. "type": "generic",
  333. "generic": {
  334. "secret": "${GENERIC_TRIGGER_SECRET}"
  335. }
  336. },
  337. {
  338. "type": "imageChange",
  339. "imageChange": {}
  340. }
  341. ]
  342. }
  343. },
  344. {
  345. "kind": "DeploymentConfig",
  346. "apiVersion": "v1",
  347. "metadata": {
  348. "name": "${APPLICATION_NAME}",
  349. "labels": {
  350. "application": "${APPLICATION_NAME}"
  351. }
  352. },
  353. "spec": {
  354. "strategy": {
  355. "type": "Recreate"
  356. },
  357. "triggers": [
  358. {
  359. "type": "ImageChange",
  360. "imageChangeParams": {
  361. "automatic": true,
  362. "containerNames": [
  363. "${APPLICATION_NAME}"
  364. ],
  365. "from": {
  366. "kind": "ImageStream",
  367. "name": "${APPLICATION_NAME}"
  368. }
  369. }
  370. }
  371. ],
  372. "replicas": 1,
  373. "selector": {
  374. "deploymentConfig": "${APPLICATION_NAME}"
  375. },
  376. "template": {
  377. "metadata": {
  378. "name": "${APPLICATION_NAME}",
  379. "labels": {
  380. "deploymentConfig": "${APPLICATION_NAME}",
  381. "application": "${APPLICATION_NAME}"
  382. }
  383. },
  384. "spec": {
  385. "serviceAccount": "eap-service-account",
  386. "containers": [
  387. {
  388. "name": "${APPLICATION_NAME}",
  389. "image": "${APPLICATION_NAME}",
  390. "imagePullPolicy": "Always",
  391. "volumeMounts": [
  392. {
  393. "name": "eap-keystore-volume",
  394. "mountPath": "/etc/eap-secret-volume",
  395. "readOnly": true
  396. }
  397. ],
  398. "readinessProbe": {
  399. "exec": {
  400. "command": [
  401. "/bin/bash",
  402. "-c",
  403. "/opt/eap/bin/readinessProbe.sh"
  404. ]
  405. }
  406. },
  407. "ports": [
  408. {
  409. "name": "${APPLICATION_NAME}-tcp-8080",
  410. "containerPort": 8080,
  411. "protocol": "TCP"
  412. },
  413. {
  414. "name": "${APPLICATION_NAME}-tcp-8443",
  415. "containerPort": 8443,
  416. "protocol": "TCP"
  417. },
  418. {
  419. "name": "${APPLICATION_NAME}-ping-8888",
  420. "containerPort": 8888,
  421. "protocol": "TCP"
  422. }
  423. ],
  424. "env": [
  425. {
  426. "name": "DB_SERVICE_PREFIX_MAPPING",
  427. "value": "${APPLICATION_NAME}-postgresql=DB"
  428. },
  429. {
  430. "name": "DB_JNDI",
  431. "value": "${DB_JNDI}"
  432. },
  433. {
  434. "name": "DB_USERNAME",
  435. "value": "${DB_USERNAME}"
  436. },
  437. {
  438. "name": "DB_PASSWORD",
  439. "value": "${DB_PASSWORD}"
  440. },
  441. {
  442. "name": "DB_DATABASE",
  443. "value": "${DB_DATABASE}"
  444. },
  445. {
  446. "name": "TX_DATABASE_PREFIX_MAPPING",
  447. "value": "${APPLICATION_NAME}-postgresql=DB"
  448. },
  449. {
  450. "name": "DB_MIN_POOL_SIZE",
  451. "value": "${DB_MIN_POOL_SIZE}"
  452. },
  453. {
  454. "name": "DB_MAX_POOL_SIZE",
  455. "value": "${DB_MAX_POOL_SIZE}"
  456. },
  457. {
  458. "name": "DB_TX_ISOLATION",
  459. "value": "${DB_TX_ISOLATION}"
  460. },
  461. {
  462. "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
  463. "value": "${APPLICATION_NAME}-ping"
  464. },
  465. {
  466. "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
  467. "value": "8888"
  468. },
  469. {
  470. "name": "EAP_HTTPS_KEYSTORE_DIR",
  471. "value": "/etc/eap-secret-volume"
  472. },
  473. {
  474. "name": "EAP_HTTPS_KEYSTORE",
  475. "value": "${EAP_HTTPS_KEYSTORE}"
  476. },
  477. {
  478. "name": "EAP_HTTPS_NAME",
  479. "value": "${EAP_HTTPS_NAME}"
  480. },
  481. {
  482. "name": "EAP_HTTPS_PASSWORD",
  483. "value": "${EAP_HTTPS_PASSWORD}"
  484. },
  485. {
  486. "name": "HORNETQ_CLUSTER_PASSWORD",
  487. "value": "${HORNETQ_CLUSTER_PASSWORD}"
  488. },
  489. {
  490. "name": "HORNETQ_QUEUES",
  491. "value": "${HORNETQ_QUEUES}"
  492. },
  493. {
  494. "name": "HORNETQ_TOPICS",
  495. "value": "${HORNETQ_TOPICS}"
  496. }
  497. ]
  498. }
  499. ],
  500. "volumes": [
  501. {
  502. "name": "eap-keystore-volume",
  503. "secret": {
  504. "secretName": "${EAP_HTTPS_SECRET}"
  505. }
  506. }
  507. ]
  508. }
  509. }
  510. }
  511. },
  512. {
  513. "kind": "DeploymentConfig",
  514. "apiVersion": "v1",
  515. "metadata": {
  516. "name": "${APPLICATION_NAME}-postgresql",
  517. "labels": {
  518. "application": "${APPLICATION_NAME}"
  519. }
  520. },
  521. "spec": {
  522. "strategy": {
  523. "type": "Recreate"
  524. },
  525. "triggers": [
  526. {
  527. "type": "ImageChange",
  528. "imageChangeParams": {
  529. "automatic": true,
  530. "containerNames": [
  531. "${APPLICATION_NAME}-postgresql"
  532. ],
  533. "from": {
  534. "kind": "ImageStreamTag",
  535. "namespace": "openshift",
  536. "name": "postgresql:latest"
  537. }
  538. }
  539. }
  540. ],
  541. "replicas": 1,
  542. "selector": {
  543. "deploymentConfig": "${APPLICATION_NAME}-postgresql"
  544. },
  545. "template": {
  546. "metadata": {
  547. "name": "${APPLICATION_NAME}-postgresql",
  548. "labels": {
  549. "deploymentConfig": "${APPLICATION_NAME}-postgresql",
  550. "application": "${APPLICATION_NAME}"
  551. }
  552. },
  553. "spec": {
  554. "containers": [
  555. {
  556. "name": "${APPLICATION_NAME}-postgresql",
  557. "image": "postgresql",
  558. "imagePullPolicy": "Always",
  559. "ports": [
  560. {
  561. "name": "${APPLICATION_NAME}-postgresql-tcp-5432",
  562. "containerPort": 5432,
  563. "protocol": "TCP"
  564. }
  565. ],
  566. "volumeMounts": [
  567. {
  568. "mountPath": "/var/lib/pgsql/data",
  569. "name": "${APPLICATION_NAME}-postgresql-pvol"
  570. }
  571. ],
  572. "env": [
  573. {
  574. "name": "POSTGRESQL_USER",
  575. "value": "${DB_USERNAME}"
  576. },
  577. {
  578. "name": "POSTGRESQL_PASSWORD",
  579. "value": "${DB_PASSWORD}"
  580. },
  581. {
  582. "name": "POSTGRESQL_DATABASE",
  583. "value": "${DB_DATABASE}"
  584. },
  585. {
  586. "name": "POSTGRESQL_MAX_CONNECTIONS",
  587. "value": "${POSTGRESQL_MAX_CONNECTIONS}"
  588. },
  589. {
  590. "name": "POSTGRESQL_SHARED_BUFFERS",
  591. "value": "${POSTGRESQL_SHARED_BUFFERS}"
  592. }
  593. ]
  594. }
  595. ],
  596. "volumes": [
  597. {
  598. "name": "${APPLICATION_NAME}-postgresql-pvol",
  599. "persistentVolumeClaim": {
  600. "claimName": "${APPLICATION_NAME}-postgresql-claim"
  601. }
  602. }
  603. ]
  604. }
  605. }
  606. }
  607. },
  608. {
  609. "apiVersion": "v1",
  610. "kind": "PersistentVolumeClaim",
  611. "metadata": {
  612. "name": "${APPLICATION_NAME}-postgresql-claim",
  613. "labels": {
  614. "application": "${APPLICATION_NAME}"
  615. }
  616. },
  617. "spec": {
  618. "accessModes": [ "ReadWriteOnce" ],
  619. "resources": {
  620. "requests": {
  621. "storage": "${VOLUME_CAPACITY}"
  622. }
  623. }
  624. }
  625. }
  626. ]
  627. }