eap6-mysql-sti.json 23 KB

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