eap64-mysql-s2i.json 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for EAP 6 MySQL applications built using S2I.",
  7. "iconClass": "icon-jboss",
  8. "tags": "eap,mysql,javaee,java,database,jboss,xpaas",
  9. "version": "1.1.0"
  10. },
  11. "name": "eap64-mysql-s2i"
  12. },
  13. "labels": {
  14. "template": "eap64-mysql-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/mysql",
  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": "Sets how the table names are stored and compared.",
  113. "name": "MYSQL_LOWER_CASE_TABLE_NAMES",
  114. "required": false
  115. },
  116. {
  117. "description": "The maximum permitted number of simultaneous client connections.",
  118. "name": "MYSQL_MAX_CONNECTIONS",
  119. "required": false
  120. },
  121. {
  122. "description": "The minimum length of the word to be included in a FULLTEXT index.",
  123. "name": "MYSQL_FT_MIN_WORD_LEN",
  124. "required": false
  125. },
  126. {
  127. "description": "The maximum length of the word to be included in a FULLTEXT index.",
  128. "name": "MYSQL_FT_MAX_WORD_LEN",
  129. "required": false
  130. },
  131. {
  132. "description": "Controls the innodb_use_native_aio setting value if the native AIO is broken.",
  133. "name": "MYSQL_AIO",
  134. "required": false
  135. },
  136. {
  137. "description": "HornetQ cluster admin password",
  138. "name": "HORNETQ_CLUSTER_PASSWORD",
  139. "from": "[a-zA-Z0-9]{8}",
  140. "generate": "expression",
  141. "required": true
  142. },
  143. {
  144. "description": "Database user name",
  145. "name": "DB_USERNAME",
  146. "from": "user[a-zA-Z0-9]{3}",
  147. "generate": "expression",
  148. "required": true
  149. },
  150. {
  151. "description": "Database user password",
  152. "name": "DB_PASSWORD",
  153. "from": "[a-zA-Z0-9]{8}",
  154. "generate": "expression",
  155. "required": true
  156. },
  157. {
  158. "description": "GitHub trigger secret",
  159. "name": "GITHUB_WEBHOOK_SECRET",
  160. "from": "[a-zA-Z0-9]{8}",
  161. "generate": "expression",
  162. "required": true
  163. },
  164. {
  165. "description": "Generic build trigger secret",
  166. "name": "GENERIC_WEBHOOK_SECRET",
  167. "from": "[a-zA-Z0-9]{8}",
  168. "generate": "expression",
  169. "required": true
  170. },
  171. {
  172. "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.",
  173. "name": "IMAGE_STREAM_NAMESPACE",
  174. "value": "openshift",
  175. "required": true
  176. }
  177. ],
  178. "objects": [
  179. {
  180. "kind": "Service",
  181. "apiVersion": "v1",
  182. "spec": {
  183. "ports": [
  184. {
  185. "port": 8080,
  186. "targetPort": 8080
  187. }
  188. ],
  189. "selector": {
  190. "deploymentConfig": "${APPLICATION_NAME}"
  191. }
  192. },
  193. "metadata": {
  194. "name": "${APPLICATION_NAME}",
  195. "labels": {
  196. "application": "${APPLICATION_NAME}"
  197. },
  198. "annotations": {
  199. "description": "The web server's http port."
  200. }
  201. }
  202. },
  203. {
  204. "kind": "Service",
  205. "apiVersion": "v1",
  206. "spec": {
  207. "ports": [
  208. {
  209. "port": 8443,
  210. "targetPort": 8443
  211. }
  212. ],
  213. "selector": {
  214. "deploymentConfig": "${APPLICATION_NAME}"
  215. }
  216. },
  217. "metadata": {
  218. "name": "secure-${APPLICATION_NAME}",
  219. "labels": {
  220. "application": "${APPLICATION_NAME}"
  221. },
  222. "annotations": {
  223. "description": "The web server's https port."
  224. }
  225. }
  226. },
  227. {
  228. "kind": "Service",
  229. "apiVersion": "v1",
  230. "spec": {
  231. "ports": [
  232. {
  233. "port": 3306,
  234. "targetPort": 3306
  235. }
  236. ],
  237. "selector": {
  238. "deploymentConfig": "${APPLICATION_NAME}-mysql"
  239. }
  240. },
  241. "metadata": {
  242. "name": "${APPLICATION_NAME}-mysql",
  243. "labels": {
  244. "application": "${APPLICATION_NAME}"
  245. },
  246. "annotations": {
  247. "description": "The database server's port."
  248. }
  249. }
  250. },
  251. {
  252. "kind": "Route",
  253. "apiVersion": "v1",
  254. "id": "${APPLICATION_NAME}-http",
  255. "metadata": {
  256. "name": "${APPLICATION_NAME}",
  257. "labels": {
  258. "application": "${APPLICATION_NAME}"
  259. },
  260. "annotations": {
  261. "description": "Route for application's http service."
  262. }
  263. },
  264. "spec": {
  265. "host": "${APPLICATION_DOMAIN}",
  266. "to": {
  267. "name": "${APPLICATION_NAME}"
  268. }
  269. }
  270. },
  271. {
  272. "kind": "Route",
  273. "apiVersion": "v1",
  274. "id": "${APPLICATION_NAME}-https",
  275. "metadata": {
  276. "name": "secure-${APPLICATION_NAME}",
  277. "labels": {
  278. "application": "${APPLICATION_NAME}"
  279. },
  280. "annotations": {
  281. "description": "Route for application's https service."
  282. }
  283. },
  284. "spec": {
  285. "host": "${APPLICATION_DOMAIN}",
  286. "to": {
  287. "name": "secure-${APPLICATION_NAME}"
  288. },
  289. "tls": {
  290. "termination": "passthrough"
  291. }
  292. }
  293. },
  294. {
  295. "kind": "ImageStream",
  296. "apiVersion": "v1",
  297. "metadata": {
  298. "name": "${APPLICATION_NAME}",
  299. "labels": {
  300. "application": "${APPLICATION_NAME}"
  301. }
  302. }
  303. },
  304. {
  305. "kind": "BuildConfig",
  306. "apiVersion": "v1",
  307. "metadata": {
  308. "name": "${APPLICATION_NAME}",
  309. "labels": {
  310. "application": "${APPLICATION_NAME}"
  311. }
  312. },
  313. "spec": {
  314. "source": {
  315. "type": "Git",
  316. "git": {
  317. "uri": "${SOURCE_REPOSITORY_URL}",
  318. "ref": "${SOURCE_REPOSITORY_REF}"
  319. },
  320. "contextDir": "${CONTEXT_DIR}"
  321. },
  322. "strategy": {
  323. "type": "Source",
  324. "sourceStrategy": {
  325. "forcePull": true,
  326. "from": {
  327. "kind": "ImageStreamTag",
  328. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  329. "name": "jboss-eap64-openshift:1.1"
  330. }
  331. }
  332. },
  333. "output": {
  334. "to": {
  335. "kind": "ImageStreamTag",
  336. "name": "${APPLICATION_NAME}:latest"
  337. }
  338. },
  339. "triggers": [
  340. {
  341. "type": "GitHub",
  342. "github": {
  343. "secret": "${GITHUB_WEBHOOK_SECRET}"
  344. }
  345. },
  346. {
  347. "type": "Generic",
  348. "generic": {
  349. "secret": "${GENERIC_WEBHOOK_SECRET}"
  350. }
  351. },
  352. {
  353. "type": "ImageChange",
  354. "imageChange": {}
  355. },
  356. {
  357. "type": "ConfigChange"
  358. }
  359. ]
  360. }
  361. },
  362. {
  363. "kind": "DeploymentConfig",
  364. "apiVersion": "v1",
  365. "metadata": {
  366. "name": "${APPLICATION_NAME}",
  367. "labels": {
  368. "application": "${APPLICATION_NAME}"
  369. }
  370. },
  371. "spec": {
  372. "strategy": {
  373. "type": "Recreate"
  374. },
  375. "triggers": [
  376. {
  377. "type": "ImageChange",
  378. "imageChangeParams": {
  379. "automatic": true,
  380. "containerNames": [
  381. "${APPLICATION_NAME}"
  382. ],
  383. "from": {
  384. "kind": "ImageStream",
  385. "name": "${APPLICATION_NAME}"
  386. }
  387. }
  388. },
  389. {
  390. "type": "ConfigChange"
  391. }
  392. ],
  393. "replicas": 1,
  394. "selector": {
  395. "deploymentConfig": "${APPLICATION_NAME}"
  396. },
  397. "template": {
  398. "metadata": {
  399. "name": "${APPLICATION_NAME}",
  400. "labels": {
  401. "deploymentConfig": "${APPLICATION_NAME}",
  402. "application": "${APPLICATION_NAME}"
  403. }
  404. },
  405. "spec": {
  406. "serviceAccount": "eap-service-account",
  407. "terminationGracePeriodSeconds": 60,
  408. "containers": [
  409. {
  410. "name": "${APPLICATION_NAME}",
  411. "image": "${APPLICATION_NAME}",
  412. "imagePullPolicy": "Always",
  413. "volumeMounts": [
  414. {
  415. "name": "eap-keystore-volume",
  416. "mountPath": "/etc/eap-secret-volume",
  417. "readOnly": true
  418. }
  419. ],
  420. "readinessProbe": {
  421. "exec": {
  422. "command": [
  423. "/bin/bash",
  424. "-c",
  425. "/opt/eap/bin/readinessProbe.sh"
  426. ]
  427. }
  428. },
  429. "ports": [
  430. {
  431. "name": "http",
  432. "containerPort": 8080,
  433. "protocol": "TCP"
  434. },
  435. {
  436. "name": "https",
  437. "containerPort": 8443,
  438. "protocol": "TCP"
  439. },
  440. {
  441. "name": "ping",
  442. "containerPort": 8888,
  443. "protocol": "TCP"
  444. }
  445. ],
  446. "env": [
  447. {
  448. "name": "DB_SERVICE_PREFIX_MAPPING",
  449. "value": "${APPLICATION_NAME}-mysql=DB"
  450. },
  451. {
  452. "name": "DB_JNDI",
  453. "value": "${DB_JNDI}"
  454. },
  455. {
  456. "name": "DB_USERNAME",
  457. "value": "${DB_USERNAME}"
  458. },
  459. {
  460. "name": "DB_PASSWORD",
  461. "value": "${DB_PASSWORD}"
  462. },
  463. {
  464. "name": "DB_DATABASE",
  465. "value": "${DB_DATABASE}"
  466. },
  467. {
  468. "name": "TX_DATABASE_PREFIX_MAPPING",
  469. "value": "${APPLICATION_NAME}-mysql=DB"
  470. },
  471. {
  472. "name": "DB_MIN_POOL_SIZE",
  473. "value": "${DB_MIN_POOL_SIZE}"
  474. },
  475. {
  476. "name": "DB_MAX_POOL_SIZE",
  477. "value": "${DB_MAX_POOL_SIZE}"
  478. },
  479. {
  480. "name": "DB_TX_ISOLATION",
  481. "value": "${DB_TX_ISOLATION}"
  482. },
  483. {
  484. "name": "OPENSHIFT_KUBE_PING_LABELS",
  485. "value": "application=${APPLICATION_NAME}"
  486. },
  487. {
  488. "name": "OPENSHIFT_KUBE_PING_NAMESPACE",
  489. "valueFrom": {
  490. "fieldRef": {
  491. "fieldPath": "metadata.namespace"
  492. }
  493. }
  494. },
  495. {
  496. "name": "EAP_HTTPS_KEYSTORE_DIR",
  497. "value": "/etc/eap-secret-volume"
  498. },
  499. {
  500. "name": "EAP_HTTPS_KEYSTORE",
  501. "value": "${EAP_HTTPS_KEYSTORE}"
  502. },
  503. {
  504. "name": "EAP_HTTPS_NAME",
  505. "value": "${EAP_HTTPS_NAME}"
  506. },
  507. {
  508. "name": "EAP_HTTPS_PASSWORD",
  509. "value": "${EAP_HTTPS_PASSWORD}"
  510. },
  511. {
  512. "name": "HORNETQ_CLUSTER_PASSWORD",
  513. "value": "${HORNETQ_CLUSTER_PASSWORD}"
  514. },
  515. {
  516. "name": "HORNETQ_QUEUES",
  517. "value": "${HORNETQ_QUEUES}"
  518. },
  519. {
  520. "name": "HORNETQ_TOPICS",
  521. "value": "${HORNETQ_TOPICS}"
  522. }
  523. ]
  524. }
  525. ],
  526. "volumes": [
  527. {
  528. "name": "eap-keystore-volume",
  529. "secret": {
  530. "secretName": "${EAP_HTTPS_SECRET}"
  531. }
  532. }
  533. ]
  534. }
  535. }
  536. }
  537. },
  538. {
  539. "kind": "DeploymentConfig",
  540. "apiVersion": "v1",
  541. "metadata": {
  542. "name": "${APPLICATION_NAME}-mysql",
  543. "labels": {
  544. "application": "${APPLICATION_NAME}"
  545. }
  546. },
  547. "spec": {
  548. "strategy": {
  549. "type": "Recreate"
  550. },
  551. "triggers": [
  552. {
  553. "type": "ImageChange",
  554. "imageChangeParams": {
  555. "automatic": true,
  556. "containerNames": [
  557. "${APPLICATION_NAME}-mysql"
  558. ],
  559. "from": {
  560. "kind": "ImageStreamTag",
  561. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  562. "name": "mysql:latest"
  563. }
  564. }
  565. },
  566. {
  567. "type": "ConfigChange"
  568. }
  569. ],
  570. "replicas": 1,
  571. "selector": {
  572. "deploymentConfig": "${APPLICATION_NAME}-mysql"
  573. },
  574. "template": {
  575. "metadata": {
  576. "name": "${APPLICATION_NAME}-mysql",
  577. "labels": {
  578. "deploymentConfig": "${APPLICATION_NAME}-mysql",
  579. "application": "${APPLICATION_NAME}"
  580. }
  581. },
  582. "spec": {
  583. "terminationGracePeriodSeconds": 60,
  584. "containers": [
  585. {
  586. "name": "${APPLICATION_NAME}-mysql",
  587. "image": "mysql",
  588. "imagePullPolicy": "Always",
  589. "ports": [
  590. {
  591. "containerPort": 3306,
  592. "protocol": "TCP"
  593. }
  594. ],
  595. "env": [
  596. {
  597. "name": "MYSQL_USER",
  598. "value": "${DB_USERNAME}"
  599. },
  600. {
  601. "name": "MYSQL_PASSWORD",
  602. "value": "${DB_PASSWORD}"
  603. },
  604. {
  605. "name": "MYSQL_DATABASE",
  606. "value": "${DB_DATABASE}"
  607. },
  608. {
  609. "name": "MYSQL_LOWER_CASE_TABLE_NAMES",
  610. "value": "${MYSQL_LOWER_CASE_TABLE_NAMES}"
  611. },
  612. {
  613. "name": "MYSQL_MAX_CONNECTIONS",
  614. "value": "${MYSQL_MAX_CONNECTIONS}"
  615. },
  616. {
  617. "name": "MYSQL_FT_MIN_WORD_LEN",
  618. "value": "${MYSQL_FT_MIN_WORD_LEN}"
  619. },
  620. {
  621. "name": "MYSQL_FT_MAX_WORD_LEN",
  622. "value": "${MYSQL_FT_MAX_WORD_LEN}"
  623. },
  624. {
  625. "name": "MYSQL_AIO",
  626. "value": "${MYSQL_AIO}"
  627. }
  628. ]
  629. }
  630. ]
  631. }
  632. }
  633. }
  634. }
  635. ]
  636. }