eap6-mysql-persistent-sti.json 24 KB

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