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. "name": "${APPLICATION_NAME}"
  334. }
  335. },
  336. "triggers": [
  337. {
  338. "type": "github",
  339. "github": {
  340. "secret": "${GITHUB_TRIGGER_SECRET}"
  341. }
  342. },
  343. {
  344. "type": "generic",
  345. "generic": {
  346. "secret": "${GENERIC_TRIGGER_SECRET}"
  347. }
  348. },
  349. {
  350. "type": "imageChange",
  351. "imageChange": {}
  352. }
  353. ]
  354. }
  355. },
  356. {
  357. "kind": "DeploymentConfig",
  358. "apiVersion": "v1",
  359. "metadata": {
  360. "name": "${APPLICATION_NAME}",
  361. "labels": {
  362. "application": "${APPLICATION_NAME}"
  363. }
  364. },
  365. "spec": {
  366. "strategy": {
  367. "type": "Recreate"
  368. },
  369. "triggers": [
  370. {
  371. "type": "ImageChange",
  372. "imageChangeParams": {
  373. "automatic": true,
  374. "containerNames": [
  375. "${APPLICATION_NAME}"
  376. ],
  377. "from": {
  378. "kind": "ImageStream",
  379. "name": "${APPLICATION_NAME}"
  380. }
  381. }
  382. }
  383. ],
  384. "replicas": 1,
  385. "selector": {
  386. "deploymentConfig": "${APPLICATION_NAME}"
  387. },
  388. "template": {
  389. "metadata": {
  390. "name": "${APPLICATION_NAME}",
  391. "labels": {
  392. "deploymentConfig": "${APPLICATION_NAME}",
  393. "application": "${APPLICATION_NAME}"
  394. }
  395. },
  396. "spec": {
  397. "serviceAccount": "eap-service-account",
  398. "containers": [
  399. {
  400. "name": "${APPLICATION_NAME}",
  401. "image": "${APPLICATION_NAME}",
  402. "imagePullPolicy": "Always",
  403. "volumeMounts": [
  404. {
  405. "name": "eap-keystore-volume",
  406. "mountPath": "/etc/eap-secret-volume",
  407. "readOnly": true
  408. }
  409. ],
  410. "readinessProbe": {
  411. "exec": {
  412. "command": [
  413. "/bin/bash",
  414. "-c",
  415. "/opt/eap/bin/readinessProbe.sh"
  416. ]
  417. }
  418. },
  419. "ports": [
  420. {
  421. "name": "${APPLICATION_NAME}-tcp-8080",
  422. "containerPort": 8080,
  423. "protocol": "TCP"
  424. },
  425. {
  426. "name": "${APPLICATION_NAME}-tcp-8443",
  427. "containerPort": 8443,
  428. "protocol": "TCP"
  429. },
  430. {
  431. "name": "${APPLICATION_NAME}-ping-8888",
  432. "containerPort": 8888,
  433. "protocol": "TCP"
  434. }
  435. ],
  436. "env": [
  437. {
  438. "name": "DB_SERVICE_PREFIX_MAPPING",
  439. "value": "${APPLICATION_NAME}-mysql=DB"
  440. },
  441. {
  442. "name": "DB_JNDI",
  443. "value": "${DB_JNDI}"
  444. },
  445. {
  446. "name": "DB_USERNAME",
  447. "value": "${DB_USERNAME}"
  448. },
  449. {
  450. "name": "DB_PASSWORD",
  451. "value": "${DB_PASSWORD}"
  452. },
  453. {
  454. "name": "DB_DATABASE",
  455. "value": "${DB_DATABASE}"
  456. },
  457. {
  458. "name": "TX_DATABASE_PREFIX_MAPPING",
  459. "value": "${APPLICATION_NAME}-mysql=DB"
  460. },
  461. {
  462. "name": "DB_MIN_POOL_SIZE",
  463. "value": "${DB_MIN_POOL_SIZE}"
  464. },
  465. {
  466. "name": "DB_MAX_POOL_SIZE",
  467. "value": "${DB_MAX_POOL_SIZE}"
  468. },
  469. {
  470. "name": "DB_TX_ISOLATION",
  471. "value": "${DB_TX_ISOLATION}"
  472. },
  473. {
  474. "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
  475. "value": "${APPLICATION_NAME}-ping"
  476. },
  477. {
  478. "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
  479. "value": "8888"
  480. },
  481. {
  482. "name": "EAP_HTTPS_KEYSTORE_DIR",
  483. "value": "/etc/eap-secret-volume"
  484. },
  485. {
  486. "name": "EAP_HTTPS_KEYSTORE",
  487. "value": "${EAP_HTTPS_KEYSTORE}"
  488. },
  489. {
  490. "name": "EAP_HTTPS_NAME",
  491. "value": "${EAP_HTTPS_NAME}"
  492. },
  493. {
  494. "name": "EAP_HTTPS_PASSWORD",
  495. "value": "${EAP_HTTPS_PASSWORD}"
  496. },
  497. {
  498. "name": "HORNETQ_CLUSTER_PASSWORD",
  499. "value": "${HORNETQ_CLUSTER_PASSWORD}"
  500. },
  501. {
  502. "name": "HORNETQ_QUEUES",
  503. "value": "${HORNETQ_QUEUES}"
  504. },
  505. {
  506. "name": "HORNETQ_TOPICS",
  507. "value": "${HORNETQ_TOPICS}"
  508. }
  509. ]
  510. }
  511. ],
  512. "volumes": [
  513. {
  514. "name": "eap-keystore-volume",
  515. "secret": {
  516. "secretName": "${EAP_HTTPS_SECRET}"
  517. }
  518. }
  519. ]
  520. }
  521. }
  522. }
  523. },
  524. {
  525. "kind": "DeploymentConfig",
  526. "apiVersion": "v1",
  527. "metadata": {
  528. "name": "${APPLICATION_NAME}-mysql",
  529. "labels": {
  530. "application": "${APPLICATION_NAME}"
  531. }
  532. },
  533. "spec": {
  534. "strategy": {
  535. "type": "Recreate"
  536. },
  537. "triggers": [
  538. {
  539. "type": "ImageChange",
  540. "imageChangeParams": {
  541. "automatic": true,
  542. "containerNames": [
  543. "${APPLICATION_NAME}-mysql"
  544. ],
  545. "from": {
  546. "kind": "ImageStreamTag",
  547. "namespace": "openshift",
  548. "name": "mysql:latest"
  549. }
  550. }
  551. }
  552. ],
  553. "replicas": 1,
  554. "selector": {
  555. "deploymentConfig": "${APPLICATION_NAME}-mysql"
  556. },
  557. "template": {
  558. "metadata": {
  559. "name": "${APPLICATION_NAME}-mysql",
  560. "labels": {
  561. "deploymentConfig": "${APPLICATION_NAME}-mysql",
  562. "application": "${APPLICATION_NAME}"
  563. }
  564. },
  565. "spec": {
  566. "containers": [
  567. {
  568. "name": "${APPLICATION_NAME}-mysql",
  569. "image": "mysql",
  570. "imagePullPolicy": "Always",
  571. "ports": [
  572. {
  573. "name": "${APPLICATION_NAME}-mysql-tcp-3306",
  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. }