eap70-mysql-s2i.json 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for EAP 7 MySQL applications built using S2I.",
  7. "iconClass": "icon-jboss",
  8. "tags": "eap,mysql,javaee,java,database,jboss,xpaas",
  9. "version": "1.3.1"
  10. },
  11. "name": "eap70-mysql-s2i"
  12. },
  13. "labels": {
  14. "template": "eap70-mysql-s2i",
  15. "xpaas": "1.3.1"
  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 http service route. Leave blank for default hostname, e.g.: <application-name>-<project>.<default-domain-suffix>",
  26. "name": "HOSTNAME_HTTP",
  27. "value": "",
  28. "required": false
  29. },
  30. {
  31. "description": "Custom hostname for https service route. Leave blank for default hostname, e.g.: secure-<application-name>-<project>.<default-domain-suffix>",
  32. "name": "HOSTNAME_HTTPS",
  33. "value": "",
  34. "required": false
  35. },
  36. {
  37. "description": "Git source URI for application",
  38. "name": "SOURCE_REPOSITORY_URL",
  39. "value": "https://github.com/jboss-openshift/openshift-quickstarts",
  40. "required": true
  41. },
  42. {
  43. "description": "Git branch/tag reference",
  44. "name": "SOURCE_REPOSITORY_REF",
  45. "value": "1.3",
  46. "required": false
  47. },
  48. {
  49. "description": "Path within Git project to build; empty for root project directory.",
  50. "name": "CONTEXT_DIR",
  51. "value": "todolist/todolist-jdbc",
  52. "required": false
  53. },
  54. {
  55. "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/mysql",
  56. "name": "DB_JNDI",
  57. "value": "java:jboss/datasources/TodoListDS",
  58. "required": false
  59. },
  60. {
  61. "description": "Database name",
  62. "name": "DB_DATABASE",
  63. "value": "root",
  64. "required": true
  65. },
  66. {
  67. "description": "Queue names",
  68. "name": "MQ_QUEUES",
  69. "value": "",
  70. "required": false
  71. },
  72. {
  73. "description": "Topic names",
  74. "name": "MQ_TOPICS",
  75. "value": "",
  76. "required": false
  77. },
  78. {
  79. "description": "The name of the secret containing the keystore file",
  80. "name": "HTTPS_SECRET",
  81. "value": "eap7-app-secret",
  82. "required": false
  83. },
  84. {
  85. "description": "The name of the keystore file within the secret",
  86. "name": "HTTPS_KEYSTORE",
  87. "value": "keystore.jks",
  88. "required": false
  89. },
  90. {
  91. "description": "The name associated with the server certificate",
  92. "name": "HTTPS_NAME",
  93. "value": "",
  94. "required": false
  95. },
  96. {
  97. "description": "The password for the keystore and certificate",
  98. "name": "HTTPS_PASSWORD",
  99. "value": "",
  100. "required": false
  101. },
  102. {
  103. "description": "Sets xa-pool/min-pool-size for the configured datasource.",
  104. "name": "DB_MIN_POOL_SIZE",
  105. "required": false
  106. },
  107. {
  108. "description": "Sets xa-pool/max-pool-size for the configured datasource.",
  109. "name": "DB_MAX_POOL_SIZE",
  110. "required": false
  111. },
  112. {
  113. "description": "Sets transaction-isolation for the configured datasource.",
  114. "name": "DB_TX_ISOLATION",
  115. "required": false
  116. },
  117. {
  118. "description": "Sets how the table names are stored and compared.",
  119. "name": "MYSQL_LOWER_CASE_TABLE_NAMES",
  120. "required": false
  121. },
  122. {
  123. "description": "The maximum permitted number of simultaneous client connections.",
  124. "name": "MYSQL_MAX_CONNECTIONS",
  125. "required": false
  126. },
  127. {
  128. "description": "The minimum length of the word to be included in a FULLTEXT index.",
  129. "name": "MYSQL_FT_MIN_WORD_LEN",
  130. "required": false
  131. },
  132. {
  133. "description": "The maximum length of the word to be included in a FULLTEXT index.",
  134. "name": "MYSQL_FT_MAX_WORD_LEN",
  135. "required": false
  136. },
  137. {
  138. "description": "Controls the innodb_use_native_aio setting value if the native AIO is broken.",
  139. "name": "MYSQL_AIO",
  140. "required": false
  141. },
  142. {
  143. "description": "A-MQ cluster admin password",
  144. "name": "MQ_CLUSTER_PASSWORD",
  145. "from": "[a-zA-Z0-9]{8}",
  146. "generate": "expression",
  147. "required": true
  148. },
  149. {
  150. "description": "Database user name",
  151. "name": "DB_USERNAME",
  152. "from": "user[a-zA-Z0-9]{3}",
  153. "generate": "expression",
  154. "required": true
  155. },
  156. {
  157. "description": "Database user password",
  158. "name": "DB_PASSWORD",
  159. "from": "[a-zA-Z0-9]{8}",
  160. "generate": "expression",
  161. "required": true
  162. },
  163. {
  164. "description": "GitHub trigger secret",
  165. "name": "GITHUB_WEBHOOK_SECRET",
  166. "from": "[a-zA-Z0-9]{8}",
  167. "generate": "expression",
  168. "required": true
  169. },
  170. {
  171. "description": "Generic build trigger secret",
  172. "name": "GENERIC_WEBHOOK_SECRET",
  173. "from": "[a-zA-Z0-9]{8}",
  174. "generate": "expression",
  175. "required": true
  176. },
  177. {
  178. "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.",
  179. "name": "IMAGE_STREAM_NAMESPACE",
  180. "value": "openshift",
  181. "required": true
  182. },
  183. {
  184. "description": "The name of the secret containing the keystore file",
  185. "name": "JGROUPS_ENCRYPT_SECRET",
  186. "value": "eap7-app-secret",
  187. "required": false
  188. },
  189. {
  190. "description": "The name of the keystore file within the secret",
  191. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  192. "value": "jgroups.jceks",
  193. "required": false
  194. },
  195. {
  196. "description": "The name associated with the server certificate",
  197. "name": "JGROUPS_ENCRYPT_NAME",
  198. "value": "",
  199. "required": false
  200. },
  201. {
  202. "description": "The password for the keystore and certificate",
  203. "name": "JGROUPS_ENCRYPT_PASSWORD",
  204. "value": "",
  205. "required": false
  206. },
  207. {
  208. "description": "JGroups cluster password",
  209. "name": "JGROUPS_CLUSTER_PASSWORD",
  210. "from": "[a-zA-Z0-9]{8}",
  211. "generate": "expression",
  212. "required": true
  213. }
  214. ],
  215. "objects": [
  216. {
  217. "kind": "Service",
  218. "apiVersion": "v1",
  219. "spec": {
  220. "ports": [
  221. {
  222. "port": 8080,
  223. "targetPort": 8080
  224. }
  225. ],
  226. "selector": {
  227. "deploymentConfig": "${APPLICATION_NAME}"
  228. }
  229. },
  230. "metadata": {
  231. "name": "${APPLICATION_NAME}",
  232. "labels": {
  233. "application": "${APPLICATION_NAME}"
  234. },
  235. "annotations": {
  236. "description": "The web server's http port."
  237. }
  238. }
  239. },
  240. {
  241. "kind": "Service",
  242. "apiVersion": "v1",
  243. "spec": {
  244. "ports": [
  245. {
  246. "port": 8443,
  247. "targetPort": 8443
  248. }
  249. ],
  250. "selector": {
  251. "deploymentConfig": "${APPLICATION_NAME}"
  252. }
  253. },
  254. "metadata": {
  255. "name": "secure-${APPLICATION_NAME}",
  256. "labels": {
  257. "application": "${APPLICATION_NAME}"
  258. },
  259. "annotations": {
  260. "description": "The web server's https port."
  261. }
  262. }
  263. },
  264. {
  265. "kind": "Service",
  266. "apiVersion": "v1",
  267. "spec": {
  268. "ports": [
  269. {
  270. "port": 3306,
  271. "targetPort": 3306
  272. }
  273. ],
  274. "selector": {
  275. "deploymentConfig": "${APPLICATION_NAME}-mysql"
  276. }
  277. },
  278. "metadata": {
  279. "name": "${APPLICATION_NAME}-mysql",
  280. "labels": {
  281. "application": "${APPLICATION_NAME}"
  282. },
  283. "annotations": {
  284. "description": "The database server's port."
  285. }
  286. }
  287. },
  288. {
  289. "kind": "Route",
  290. "apiVersion": "v1",
  291. "id": "${APPLICATION_NAME}-http",
  292. "metadata": {
  293. "name": "${APPLICATION_NAME}",
  294. "labels": {
  295. "application": "${APPLICATION_NAME}"
  296. },
  297. "annotations": {
  298. "description": "Route for application's http service."
  299. }
  300. },
  301. "spec": {
  302. "host": "${HOSTNAME_HTTP}",
  303. "to": {
  304. "name": "${APPLICATION_NAME}"
  305. }
  306. }
  307. },
  308. {
  309. "kind": "Route",
  310. "apiVersion": "v1",
  311. "id": "${APPLICATION_NAME}-https",
  312. "metadata": {
  313. "name": "secure-${APPLICATION_NAME}",
  314. "labels": {
  315. "application": "${APPLICATION_NAME}"
  316. },
  317. "annotations": {
  318. "description": "Route for application's https service."
  319. }
  320. },
  321. "spec": {
  322. "host": "${HOSTNAME_HTTPS}",
  323. "to": {
  324. "name": "secure-${APPLICATION_NAME}"
  325. },
  326. "tls": {
  327. "termination": "passthrough"
  328. }
  329. }
  330. },
  331. {
  332. "kind": "ImageStream",
  333. "apiVersion": "v1",
  334. "metadata": {
  335. "name": "${APPLICATION_NAME}",
  336. "labels": {
  337. "application": "${APPLICATION_NAME}"
  338. }
  339. }
  340. },
  341. {
  342. "kind": "BuildConfig",
  343. "apiVersion": "v1",
  344. "metadata": {
  345. "name": "${APPLICATION_NAME}",
  346. "labels": {
  347. "application": "${APPLICATION_NAME}"
  348. }
  349. },
  350. "spec": {
  351. "source": {
  352. "type": "Git",
  353. "git": {
  354. "uri": "${SOURCE_REPOSITORY_URL}",
  355. "ref": "${SOURCE_REPOSITORY_REF}"
  356. },
  357. "contextDir": "${CONTEXT_DIR}"
  358. },
  359. "strategy": {
  360. "type": "Source",
  361. "sourceStrategy": {
  362. "forcePull": true,
  363. "from": {
  364. "kind": "ImageStreamTag",
  365. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  366. "name": "jboss-eap70-openshift:1.3"
  367. }
  368. }
  369. },
  370. "output": {
  371. "to": {
  372. "kind": "ImageStreamTag",
  373. "name": "${APPLICATION_NAME}:latest"
  374. }
  375. },
  376. "triggers": [
  377. {
  378. "type": "GitHub",
  379. "github": {
  380. "secret": "${GITHUB_WEBHOOK_SECRET}"
  381. }
  382. },
  383. {
  384. "type": "Generic",
  385. "generic": {
  386. "secret": "${GENERIC_WEBHOOK_SECRET}"
  387. }
  388. },
  389. {
  390. "type": "ImageChange",
  391. "imageChange": {}
  392. },
  393. {
  394. "type": "ConfigChange"
  395. }
  396. ]
  397. }
  398. },
  399. {
  400. "kind": "DeploymentConfig",
  401. "apiVersion": "v1",
  402. "metadata": {
  403. "name": "${APPLICATION_NAME}",
  404. "labels": {
  405. "application": "${APPLICATION_NAME}"
  406. }
  407. },
  408. "spec": {
  409. "strategy": {
  410. "type": "Recreate"
  411. },
  412. "triggers": [
  413. {
  414. "type": "ImageChange",
  415. "imageChangeParams": {
  416. "automatic": true,
  417. "containerNames": [
  418. "${APPLICATION_NAME}"
  419. ],
  420. "from": {
  421. "kind": "ImageStream",
  422. "name": "${APPLICATION_NAME}"
  423. }
  424. }
  425. },
  426. {
  427. "type": "ConfigChange"
  428. }
  429. ],
  430. "replicas": 1,
  431. "selector": {
  432. "deploymentConfig": "${APPLICATION_NAME}"
  433. },
  434. "template": {
  435. "metadata": {
  436. "name": "${APPLICATION_NAME}",
  437. "labels": {
  438. "deploymentConfig": "${APPLICATION_NAME}",
  439. "application": "${APPLICATION_NAME}"
  440. }
  441. },
  442. "spec": {
  443. "serviceAccountName": "eap7-service-account",
  444. "terminationGracePeriodSeconds": 60,
  445. "containers": [
  446. {
  447. "name": "${APPLICATION_NAME}",
  448. "image": "${APPLICATION_NAME}",
  449. "imagePullPolicy": "Always",
  450. "volumeMounts": [
  451. {
  452. "name": "eap-keystore-volume",
  453. "mountPath": "/etc/eap-secret-volume",
  454. "readOnly": true
  455. },
  456. {
  457. "name": "eap-jgroups-keystore-volume",
  458. "mountPath": "/etc/jgroups-encrypt-secret-volume",
  459. "readOnly": true
  460. }
  461. ],
  462. "livenessProbe": {
  463. "exec": {
  464. "command": [
  465. "/bin/bash",
  466. "-c",
  467. "/opt/eap/bin/livenessProbe.sh"
  468. ]
  469. }
  470. },
  471. "readinessProbe": {
  472. "exec": {
  473. "command": [
  474. "/bin/bash",
  475. "-c",
  476. "/opt/eap/bin/readinessProbe.sh"
  477. ]
  478. }
  479. },
  480. "ports": [
  481. {
  482. "name": "jolokia",
  483. "containerPort": 8778,
  484. "protocol": "TCP"
  485. },
  486. {
  487. "name": "http",
  488. "containerPort": 8080,
  489. "protocol": "TCP"
  490. },
  491. {
  492. "name": "https",
  493. "containerPort": 8443,
  494. "protocol": "TCP"
  495. },
  496. {
  497. "name": "ping",
  498. "containerPort": 8888,
  499. "protocol": "TCP"
  500. }
  501. ],
  502. "env": [
  503. {
  504. "name": "DB_SERVICE_PREFIX_MAPPING",
  505. "value": "${APPLICATION_NAME}-mysql=DB"
  506. },
  507. {
  508. "name": "DB_JNDI",
  509. "value": "${DB_JNDI}"
  510. },
  511. {
  512. "name": "DB_USERNAME",
  513. "value": "${DB_USERNAME}"
  514. },
  515. {
  516. "name": "DB_PASSWORD",
  517. "value": "${DB_PASSWORD}"
  518. },
  519. {
  520. "name": "DB_DATABASE",
  521. "value": "${DB_DATABASE}"
  522. },
  523. {
  524. "name": "TX_DATABASE_PREFIX_MAPPING",
  525. "value": "${APPLICATION_NAME}-mysql=DB"
  526. },
  527. {
  528. "name": "DB_MIN_POOL_SIZE",
  529. "value": "${DB_MIN_POOL_SIZE}"
  530. },
  531. {
  532. "name": "DB_MAX_POOL_SIZE",
  533. "value": "${DB_MAX_POOL_SIZE}"
  534. },
  535. {
  536. "name": "DB_TX_ISOLATION",
  537. "value": "${DB_TX_ISOLATION}"
  538. },
  539. {
  540. "name": "OPENSHIFT_KUBE_PING_LABELS",
  541. "value": "application=${APPLICATION_NAME}"
  542. },
  543. {
  544. "name": "OPENSHIFT_KUBE_PING_NAMESPACE",
  545. "valueFrom": {
  546. "fieldRef": {
  547. "fieldPath": "metadata.namespace"
  548. }
  549. }
  550. },
  551. {
  552. "name": "HTTPS_KEYSTORE_DIR",
  553. "value": "/etc/eap-secret-volume"
  554. },
  555. {
  556. "name": "HTTPS_KEYSTORE",
  557. "value": "${HTTPS_KEYSTORE}"
  558. },
  559. {
  560. "name": "HTTPS_NAME",
  561. "value": "${HTTPS_NAME}"
  562. },
  563. {
  564. "name": "HTTPS_PASSWORD",
  565. "value": "${HTTPS_PASSWORD}"
  566. },
  567. {
  568. "name": "MQ_CLUSTER_PASSWORD",
  569. "value": "${MQ_CLUSTER_PASSWORD}"
  570. },
  571. {
  572. "name": "MQ_QUEUES",
  573. "value": "${MQ_QUEUES}"
  574. },
  575. {
  576. "name": "MQ_TOPICS",
  577. "value": "${MQ_TOPICS}"
  578. },
  579. {
  580. "name": "JGROUPS_ENCRYPT_SECRET",
  581. "value": "${JGROUPS_ENCRYPT_SECRET}"
  582. },
  583. {
  584. "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR",
  585. "value": "/etc/jgroups-encrypt-secret-volume"
  586. },
  587. {
  588. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  589. "value": "${JGROUPS_ENCRYPT_KEYSTORE}"
  590. },
  591. {
  592. "name": "JGROUPS_ENCRYPT_NAME",
  593. "value": "${JGROUPS_ENCRYPT_NAME}"
  594. },
  595. {
  596. "name": "JGROUPS_ENCRYPT_PASSWORD",
  597. "value": "${JGROUPS_ENCRYPT_PASSWORD}"
  598. },
  599. {
  600. "name": "JGROUPS_CLUSTER_PASSWORD",
  601. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  602. },
  603. {
  604. "name": "DEFAULT_JOB_REPOSITORY",
  605. "value": "${APPLICATION_NAME}-mysql"
  606. },
  607. {
  608. "name": "TIMER_SERVICE_DATA_STORE",
  609. "value": "${APPLICATION_NAME}-mysql"
  610. }
  611. ]
  612. }
  613. ],
  614. "volumes": [
  615. {
  616. "name": "eap-keystore-volume",
  617. "secret": {
  618. "secretName": "${HTTPS_SECRET}"
  619. }
  620. },
  621. {
  622. "name": "eap-jgroups-keystore-volume",
  623. "secret": {
  624. "secretName": "${JGROUPS_ENCRYPT_SECRET}"
  625. }
  626. }
  627. ]
  628. }
  629. }
  630. }
  631. },
  632. {
  633. "kind": "DeploymentConfig",
  634. "apiVersion": "v1",
  635. "metadata": {
  636. "name": "${APPLICATION_NAME}-mysql",
  637. "labels": {
  638. "application": "${APPLICATION_NAME}"
  639. }
  640. },
  641. "spec": {
  642. "strategy": {
  643. "type": "Recreate"
  644. },
  645. "triggers": [
  646. {
  647. "type": "ImageChange",
  648. "imageChangeParams": {
  649. "automatic": true,
  650. "containerNames": [
  651. "${APPLICATION_NAME}-mysql"
  652. ],
  653. "from": {
  654. "kind": "ImageStreamTag",
  655. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  656. "name": "mysql:latest"
  657. }
  658. }
  659. },
  660. {
  661. "type": "ConfigChange"
  662. }
  663. ],
  664. "replicas": 1,
  665. "selector": {
  666. "deploymentConfig": "${APPLICATION_NAME}-mysql"
  667. },
  668. "template": {
  669. "metadata": {
  670. "name": "${APPLICATION_NAME}-mysql",
  671. "labels": {
  672. "deploymentConfig": "${APPLICATION_NAME}-mysql",
  673. "application": "${APPLICATION_NAME}"
  674. }
  675. },
  676. "spec": {
  677. "terminationGracePeriodSeconds": 60,
  678. "containers": [
  679. {
  680. "name": "${APPLICATION_NAME}-mysql",
  681. "image": "mysql",
  682. "imagePullPolicy": "Always",
  683. "ports": [
  684. {
  685. "containerPort": 3306,
  686. "protocol": "TCP"
  687. }
  688. ],
  689. "env": [
  690. {
  691. "name": "MYSQL_USER",
  692. "value": "${DB_USERNAME}"
  693. },
  694. {
  695. "name": "MYSQL_PASSWORD",
  696. "value": "${DB_PASSWORD}"
  697. },
  698. {
  699. "name": "MYSQL_DATABASE",
  700. "value": "${DB_DATABASE}"
  701. },
  702. {
  703. "name": "MYSQL_LOWER_CASE_TABLE_NAMES",
  704. "value": "${MYSQL_LOWER_CASE_TABLE_NAMES}"
  705. },
  706. {
  707. "name": "MYSQL_MAX_CONNECTIONS",
  708. "value": "${MYSQL_MAX_CONNECTIONS}"
  709. },
  710. {
  711. "name": "MYSQL_FT_MIN_WORD_LEN",
  712. "value": "${MYSQL_FT_MIN_WORD_LEN}"
  713. },
  714. {
  715. "name": "MYSQL_FT_MAX_WORD_LEN",
  716. "value": "${MYSQL_FT_MAX_WORD_LEN}"
  717. },
  718. {
  719. "name": "MYSQL_AIO",
  720. "value": "${MYSQL_AIO}"
  721. }
  722. ]
  723. }
  724. ]
  725. }
  726. }
  727. }
  728. }
  729. ]
  730. }