eap64-postgresql-s2i.json 23 KB

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