eap-cd-mysql-persistent-s2i.json 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "iconClass": "icon-eap",
  7. "tags": "eap,javaee,java,jboss",
  8. "version": "1.5.0",
  9. "openshift.io/display-name": "JBoss EAP CD + MySQL (with https)",
  10. "openshift.io/provider-display-name": "Red Hat, Inc.",
  11. "description": "An example JBoss Enterprise Application Platform continuous delivery application with a MySQL database. For more information about using this template, see https://github.com/jboss-container-images/jboss-eap-7-openshift-image/blob/eap-cd/README.adoc.",
  12. "template.openshift.io/long-description": "This template defines resources needed to develop JBoss Enterprise Application Server continuous delivery based application, including a build configuration, application deployment configuration, database deployment configuration for MySQL using persistence and secure communication using https.",
  13. "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/",
  14. "template.openshift.io/support-url": "https://access.redhat.com"
  15. },
  16. "name": "eap-cd-mysql-persistent-s2i"
  17. },
  18. "labels": {
  19. "template": "eap-cd-mysql-persistent-s2i",
  20. "xpaas": "1.5.0"
  21. },
  22. "message": "A new EAP CD and MySQL persistent based application with SSL support has been created in your project. The username/password for accessing the MySQL database \"${DB_DATABASE}\" is ${DB_USERNAME}/${DB_PASSWORD}. Please be sure to create the following secrets: \"${HTTPS_SECRET}\" containing the ${HTTPS_KEYSTORE} file used for serving secure content; \"${JGROUPS_ENCRYPT_SECRET}\" containing the ${JGROUPS_ENCRYPT_KEYSTORE} file used for securing JGroups communications.",
  23. "parameters": [
  24. {
  25. "displayName": "Application Name",
  26. "description": "The name for the application.",
  27. "name": "APPLICATION_NAME",
  28. "value": "eap-app",
  29. "required": true
  30. },
  31. {
  32. "displayName": "Custom https Route Hostname",
  33. "description": "Custom hostname for https service route. Leave blank for default hostname, e.g.: secure-<application-name>-<project>.<default-domain-suffix>",
  34. "name": "HOSTNAME_HTTPS",
  35. "value": "",
  36. "required": false
  37. },
  38. {
  39. "displayName": "Git Repository URL",
  40. "description": "Git source URI for application",
  41. "name": "SOURCE_REPOSITORY_URL",
  42. "value": "https://github.com/jboss-openshift/openshift-quickstarts",
  43. "required": true
  44. },
  45. {
  46. "displayName": "Git Reference",
  47. "description": "Git branch/tag reference",
  48. "name": "SOURCE_REPOSITORY_REF",
  49. "value": "1.3",
  50. "required": false
  51. },
  52. {
  53. "displayName": "Context Directory",
  54. "description": "Path within Git project to build; empty for root project directory.",
  55. "name": "CONTEXT_DIR",
  56. "value": "todolist/todolist-jdbc",
  57. "required": false
  58. },
  59. {
  60. "displayName": "Database JNDI Name",
  61. "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/mysql",
  62. "name": "DB_JNDI",
  63. "value": "java:jboss/datasources/TodoListDS",
  64. "required": false
  65. },
  66. {
  67. "displayName": "Database Name",
  68. "description": "Database name",
  69. "name": "DB_DATABASE",
  70. "value": "root",
  71. "required": true
  72. },
  73. {
  74. "displayName": "Database Volume Capacity",
  75. "description": "Size of persistent storage for database volume.",
  76. "name": "VOLUME_CAPACITY",
  77. "value": "1Gi",
  78. "required": true
  79. },
  80. {
  81. "displayName": "Queues",
  82. "description": "Queue names, separated by commas. These queues will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all queues used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.",
  83. "name": "MQ_QUEUES",
  84. "value": "",
  85. "required": false
  86. },
  87. {
  88. "displayName": "Topics",
  89. "description": "Topic names, separated by commas. These topics will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all topics used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.",
  90. "name": "MQ_TOPICS",
  91. "value": "",
  92. "required": false
  93. },
  94. {
  95. "displayName": "Server Keystore Secret Name",
  96. "description": "The name of the secret containing the keystore file",
  97. "name": "HTTPS_SECRET",
  98. "value": "eap7-app-secret",
  99. "required": true
  100. },
  101. {
  102. "displayName": "Server Keystore Filename",
  103. "description": "The name of the keystore file within the secret",
  104. "name": "HTTPS_KEYSTORE",
  105. "value": "keystore.jks",
  106. "required": false
  107. },
  108. {
  109. "displayName": "Server Keystore Type",
  110. "description": "The type of the keystore file (JKS or JCEKS)",
  111. "name": "HTTPS_KEYSTORE_TYPE",
  112. "value": "",
  113. "required": false
  114. },
  115. {
  116. "displayName": "Server Certificate Name",
  117. "description": "The name associated with the server certificate",
  118. "name": "HTTPS_NAME",
  119. "value": "",
  120. "required": false
  121. },
  122. {
  123. "displayName": "Server Keystore Password",
  124. "description": "The password for the keystore and certificate",
  125. "name": "HTTPS_PASSWORD",
  126. "value": "",
  127. "required": false
  128. },
  129. {
  130. "displayName": "Datasource Minimum Pool Size",
  131. "description": "Sets xa-pool/min-pool-size for the configured datasource.",
  132. "name": "DB_MIN_POOL_SIZE",
  133. "required": false
  134. },
  135. {
  136. "displayName": "Datasource Maximum Pool Size",
  137. "description": "Sets xa-pool/max-pool-size for the configured datasource.",
  138. "name": "DB_MAX_POOL_SIZE",
  139. "required": false
  140. },
  141. {
  142. "displayName": "Datasource Transaction Isolation",
  143. "description": "Sets transaction-isolation for the configured datasource.",
  144. "name": "DB_TX_ISOLATION",
  145. "required": false
  146. },
  147. {
  148. "displayName": "MySQL Lower Case Table Names",
  149. "description": "Sets how the table names are stored and compared.",
  150. "name": "MYSQL_LOWER_CASE_TABLE_NAMES",
  151. "required": false
  152. },
  153. {
  154. "displayName": "MySQL Maximum number of connections",
  155. "description": "The maximum permitted number of simultaneous client connections.",
  156. "name": "MYSQL_MAX_CONNECTIONS",
  157. "required": false
  158. },
  159. {
  160. "displayName": "MySQL FullText Minimum Word Length",
  161. "description": "The minimum length of the word to be included in a FULLTEXT index.",
  162. "name": "MYSQL_FT_MIN_WORD_LEN",
  163. "required": false
  164. },
  165. {
  166. "displayName": "MySQL FullText Maximum Word Length",
  167. "description": "The maximum length of the word to be included in a FULLTEXT index.",
  168. "name": "MYSQL_FT_MAX_WORD_LEN",
  169. "required": false
  170. },
  171. {
  172. "displayName": "MySQL AIO",
  173. "description": "Controls the innodb_use_native_aio setting value if the native AIO is broken.",
  174. "name": "MYSQL_AIO",
  175. "required": false
  176. },
  177. {
  178. "displayName": "AMQ cluster password",
  179. "description": "AMQ cluster admin password",
  180. "name": "MQ_CLUSTER_PASSWORD",
  181. "from": "[a-zA-Z0-9]{8}",
  182. "generate": "expression",
  183. "required": true
  184. },
  185. {
  186. "displayName": "Database Username",
  187. "description": "Database user name",
  188. "name": "DB_USERNAME",
  189. "from": "user[a-zA-Z0-9]{3}",
  190. "generate": "expression",
  191. "required": true
  192. },
  193. {
  194. "displayName": "Database Password",
  195. "description": "Database user password",
  196. "name": "DB_PASSWORD",
  197. "from": "[a-zA-Z0-9]{8}",
  198. "generate": "expression",
  199. "required": true
  200. },
  201. {
  202. "displayName": "Github Webhook Secret",
  203. "description": "GitHub trigger secret",
  204. "name": "GITHUB_WEBHOOK_SECRET",
  205. "from": "[a-zA-Z0-9]{8}",
  206. "generate": "expression",
  207. "required": true
  208. },
  209. {
  210. "displayName": "Generic Webhook Secret",
  211. "description": "Generic build trigger secret",
  212. "name": "GENERIC_WEBHOOK_SECRET",
  213. "from": "[a-zA-Z0-9]{8}",
  214. "generate": "expression",
  215. "required": true
  216. },
  217. {
  218. "displayName": "ImageStream Namespace",
  219. "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.",
  220. "name": "IMAGE_STREAM_NAMESPACE",
  221. "value": "openshift",
  222. "required": true
  223. },
  224. {
  225. "displayName": "JGroups Secret Name",
  226. "description": "The name of the secret containing the keystore file",
  227. "name": "JGROUPS_ENCRYPT_SECRET",
  228. "value": "eap7-app-secret",
  229. "required": false
  230. },
  231. {
  232. "displayName": "JGroups Keystore Filename",
  233. "description": "The name of the keystore file within the secret",
  234. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  235. "value": "jgroups.jceks",
  236. "required": false
  237. },
  238. {
  239. "displayName": "JGroups Certificate Name",
  240. "description": "The name associated with the server certificate",
  241. "name": "JGROUPS_ENCRYPT_NAME",
  242. "value": "",
  243. "required": false
  244. },
  245. {
  246. "displayName": "JGroups Keystore Password",
  247. "description": "The password for the keystore and certificate",
  248. "name": "JGROUPS_ENCRYPT_PASSWORD",
  249. "value": "",
  250. "required": false
  251. },
  252. {
  253. "displayName": "JGroups Cluster Password",
  254. "description": "JGroups cluster password",
  255. "name": "JGROUPS_CLUSTER_PASSWORD",
  256. "from": "[a-zA-Z0-9]{8}",
  257. "generate": "expression",
  258. "required": true
  259. },
  260. {
  261. "displayName": "Deploy Exploded Archives",
  262. "description": "Controls whether exploded deployment content should be automatically deployed",
  263. "name": "AUTO_DEPLOY_EXPLODED",
  264. "value": "false",
  265. "required": false
  266. },
  267. {
  268. "displayName": "Maven mirror URL",
  269. "description": "Maven mirror to use for S2I builds",
  270. "name": "MAVEN_MIRROR_URL",
  271. "value": "",
  272. "required": false
  273. },
  274. {
  275. "displayName": "Maven Additional Arguments",
  276. "description": "Maven additional arguments to use for S2I builds",
  277. "name": "MAVEN_ARGS_APPEND",
  278. "value": "",
  279. "required": false
  280. },
  281. {
  282. "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.",
  283. "name": "ARTIFACT_DIR",
  284. "value": "",
  285. "required": false
  286. },
  287. {
  288. "displayName": "MySQL Image Stream Tag",
  289. "description": "The tag to use for the \"mysql\" image stream. Typically, this aligns with the major.minor version of MySQL.",
  290. "name": "MYSQL_IMAGE_STREAM_TAG",
  291. "value": "5.7",
  292. "required": true
  293. },
  294. {
  295. "description": "Container memory limit",
  296. "name": "MEMORY_LIMIT",
  297. "value": "1Gi",
  298. "required": false
  299. }
  300. ],
  301. "objects": [
  302. {
  303. "kind": "Service",
  304. "apiVersion": "v1",
  305. "spec": {
  306. "ports": [
  307. {
  308. "port": 8080,
  309. "targetPort": 8080
  310. }
  311. ],
  312. "selector": {
  313. "deploymentConfig": "${APPLICATION_NAME}"
  314. }
  315. },
  316. "metadata": {
  317. "name": "${APPLICATION_NAME}",
  318. "labels": {
  319. "application": "${APPLICATION_NAME}"
  320. },
  321. "annotations": {
  322. "description": "The web server's http port.",
  323. "service.alpha.openshift.io/dependencies": "[{\"name\": \"${APPLICATION_NAME}-mysql\", \"kind\": \"Service\"}]"
  324. }
  325. }
  326. },
  327. {
  328. "kind": "Service",
  329. "apiVersion": "v1",
  330. "spec": {
  331. "ports": [
  332. {
  333. "port": 8443,
  334. "targetPort": 8443
  335. }
  336. ],
  337. "selector": {
  338. "deploymentConfig": "${APPLICATION_NAME}"
  339. }
  340. },
  341. "metadata": {
  342. "name": "secure-${APPLICATION_NAME}",
  343. "labels": {
  344. "application": "${APPLICATION_NAME}"
  345. },
  346. "annotations": {
  347. "description": "The web server's https port.",
  348. "service.alpha.openshift.io/dependencies": "[{\"name\": \"${APPLICATION_NAME}-mysql\", \"kind\": \"Service\"}]"
  349. }
  350. }
  351. },
  352. {
  353. "kind": "Service",
  354. "apiVersion": "v1",
  355. "spec": {
  356. "ports": [
  357. {
  358. "port": 3306,
  359. "targetPort": 3306
  360. }
  361. ],
  362. "selector": {
  363. "deploymentConfig": "${APPLICATION_NAME}-mysql"
  364. }
  365. },
  366. "metadata": {
  367. "name": "${APPLICATION_NAME}-mysql",
  368. "labels": {
  369. "application": "${APPLICATION_NAME}"
  370. },
  371. "annotations": {
  372. "description": "The database server's port."
  373. }
  374. }
  375. },
  376. {
  377. "kind": "Service",
  378. "apiVersion": "v1",
  379. "spec": {
  380. "clusterIP": "None",
  381. "ports": [
  382. {
  383. "name": "ping",
  384. "port": 8888
  385. }
  386. ],
  387. "selector": {
  388. "deploymentConfig": "${APPLICATION_NAME}"
  389. }
  390. },
  391. "metadata": {
  392. "name": "${APPLICATION_NAME}-ping",
  393. "labels": {
  394. "application": "${APPLICATION_NAME}"
  395. },
  396. "annotations": {
  397. "service.alpha.kubernetes.io/tolerate-unready-endpoints": "true",
  398. "description": "The JGroups ping port for clustering."
  399. }
  400. }
  401. },
  402. {
  403. "kind": "Route",
  404. "apiVersion": "v1",
  405. "id": "${APPLICATION_NAME}-http",
  406. "metadata": {
  407. "name": "${APPLICATION_NAME}",
  408. "labels": {
  409. "application": "${APPLICATION_NAME}"
  410. },
  411. "annotations": {
  412. "description": "Route for application's http service."
  413. }
  414. },
  415. "spec": {
  416. "to": {
  417. "name": "${APPLICATION_NAME}"
  418. }
  419. }
  420. },
  421. {
  422. "kind": "Route",
  423. "apiVersion": "v1",
  424. "id": "${APPLICATION_NAME}-https",
  425. "metadata": {
  426. "name": "secure-${APPLICATION_NAME}",
  427. "labels": {
  428. "application": "${APPLICATION_NAME}"
  429. },
  430. "annotations": {
  431. "description": "Route for application's https service."
  432. }
  433. },
  434. "spec": {
  435. "host": "${HOSTNAME_HTTPS}",
  436. "to": {
  437. "name": "secure-${APPLICATION_NAME}"
  438. },
  439. "tls": {
  440. "termination": "passthrough"
  441. }
  442. }
  443. },
  444. {
  445. "kind": "ImageStream",
  446. "apiVersion": "v1",
  447. "metadata": {
  448. "name": "${APPLICATION_NAME}",
  449. "labels": {
  450. "application": "${APPLICATION_NAME}"
  451. }
  452. }
  453. },
  454. {
  455. "kind": "BuildConfig",
  456. "apiVersion": "v1",
  457. "metadata": {
  458. "name": "${APPLICATION_NAME}",
  459. "labels": {
  460. "application": "${APPLICATION_NAME}"
  461. }
  462. },
  463. "spec": {
  464. "source": {
  465. "type": "Git",
  466. "git": {
  467. "uri": "${SOURCE_REPOSITORY_URL}",
  468. "ref": "${SOURCE_REPOSITORY_REF}"
  469. },
  470. "contextDir": "${CONTEXT_DIR}"
  471. },
  472. "strategy": {
  473. "type": "Source",
  474. "sourceStrategy": {
  475. "env": [
  476. {
  477. "name": "MAVEN_MIRROR_URL",
  478. "value": "${MAVEN_MIRROR_URL}"
  479. },
  480. {
  481. "name": "MAVEN_ARGS_APPEND",
  482. "value": "${MAVEN_ARGS_APPEND}"
  483. },
  484. {
  485. "name": "ARTIFACT_DIR",
  486. "value": "${ARTIFACT_DIR}"
  487. }
  488. ],
  489. "forcePull": true,
  490. "from": {
  491. "kind": "ImageStreamTag",
  492. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  493. "name": "eap-cd-openshift:13"
  494. }
  495. }
  496. },
  497. "output": {
  498. "to": {
  499. "kind": "ImageStreamTag",
  500. "name": "${APPLICATION_NAME}:latest"
  501. }
  502. },
  503. "triggers": [
  504. {
  505. "type": "GitHub",
  506. "github": {
  507. "secret": "${GITHUB_WEBHOOK_SECRET}"
  508. }
  509. },
  510. {
  511. "type": "Generic",
  512. "generic": {
  513. "secret": "${GENERIC_WEBHOOK_SECRET}"
  514. }
  515. },
  516. {
  517. "type": "ImageChange",
  518. "imageChange": {}
  519. },
  520. {
  521. "type": "ConfigChange"
  522. }
  523. ]
  524. }
  525. },
  526. {
  527. "kind": "DeploymentConfig",
  528. "apiVersion": "v1",
  529. "metadata": {
  530. "name": "${APPLICATION_NAME}",
  531. "labels": {
  532. "application": "${APPLICATION_NAME}"
  533. }
  534. },
  535. "spec": {
  536. "strategy": {
  537. "type": "Recreate"
  538. },
  539. "triggers": [
  540. {
  541. "type": "ImageChange",
  542. "imageChangeParams": {
  543. "automatic": true,
  544. "containerNames": [
  545. "${APPLICATION_NAME}"
  546. ],
  547. "from": {
  548. "kind": "ImageStreamTag",
  549. "name": "${APPLICATION_NAME}:latest"
  550. }
  551. }
  552. },
  553. {
  554. "type": "ConfigChange"
  555. }
  556. ],
  557. "replicas": 1,
  558. "selector": {
  559. "deploymentConfig": "${APPLICATION_NAME}"
  560. },
  561. "template": {
  562. "metadata": {
  563. "name": "${APPLICATION_NAME}",
  564. "labels": {
  565. "deploymentConfig": "${APPLICATION_NAME}",
  566. "application": "${APPLICATION_NAME}"
  567. }
  568. },
  569. "spec": {
  570. "terminationGracePeriodSeconds": 75,
  571. "containers": [
  572. {
  573. "name": "${APPLICATION_NAME}",
  574. "image": "${APPLICATION_NAME}",
  575. "imagePullPolicy": "Always",
  576. "resources": {
  577. "limits": {
  578. "memory": "${MEMORY_LIMIT}"
  579. }
  580. },
  581. "volumeMounts": [
  582. {
  583. "name": "eap-keystore-volume",
  584. "mountPath": "/etc/eap-secret-volume",
  585. "readOnly": true
  586. },
  587. {
  588. "name": "eap-jgroups-keystore-volume",
  589. "mountPath": "/etc/jgroups-encrypt-secret-volume",
  590. "readOnly": true
  591. }
  592. ],
  593. "livenessProbe": {
  594. "exec": {
  595. "command": [
  596. "/bin/bash",
  597. "-c",
  598. "/opt/eap/bin/livenessProbe.sh"
  599. ]
  600. },
  601. "initialDelaySeconds": 60
  602. },
  603. "readinessProbe": {
  604. "exec": {
  605. "command": [
  606. "/bin/bash",
  607. "-c",
  608. "/opt/eap/bin/readinessProbe.sh"
  609. ]
  610. }
  611. },
  612. "ports": [
  613. {
  614. "name": "jolokia",
  615. "containerPort": 8778,
  616. "protocol": "TCP"
  617. },
  618. {
  619. "name": "http",
  620. "containerPort": 8080,
  621. "protocol": "TCP"
  622. },
  623. {
  624. "name": "https",
  625. "containerPort": 8443,
  626. "protocol": "TCP"
  627. },
  628. {
  629. "name": "ping",
  630. "containerPort": 8888,
  631. "protocol": "TCP"
  632. }
  633. ],
  634. "env": [
  635. {
  636. "name": "DB_SERVICE_PREFIX_MAPPING",
  637. "value": "${APPLICATION_NAME}-mysql=DB"
  638. },
  639. {
  640. "name": "DB_JNDI",
  641. "value": "${DB_JNDI}"
  642. },
  643. {
  644. "name": "DB_USERNAME",
  645. "value": "${DB_USERNAME}"
  646. },
  647. {
  648. "name": "DB_PASSWORD",
  649. "value": "${DB_PASSWORD}"
  650. },
  651. {
  652. "name": "DB_DATABASE",
  653. "value": "${DB_DATABASE}"
  654. },
  655. {
  656. "name": "TX_DATABASE_PREFIX_MAPPING",
  657. "value": "${APPLICATION_NAME}-mysql=DB"
  658. },
  659. {
  660. "name": "DB_MIN_POOL_SIZE",
  661. "value": "${DB_MIN_POOL_SIZE}"
  662. },
  663. {
  664. "name": "DB_MAX_POOL_SIZE",
  665. "value": "${DB_MAX_POOL_SIZE}"
  666. },
  667. {
  668. "name": "DB_TX_ISOLATION",
  669. "value": "${DB_TX_ISOLATION}"
  670. },
  671. {
  672. "name": "JGROUPS_PING_PROTOCOL",
  673. "value": "openshift.DNS_PING"
  674. },
  675. {
  676. "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
  677. "value": "${APPLICATION_NAME}-ping"
  678. },
  679. {
  680. "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
  681. "value": "8888"
  682. },
  683. {
  684. "name": "HTTPS_KEYSTORE_DIR",
  685. "value": "/etc/eap-secret-volume"
  686. },
  687. {
  688. "name": "HTTPS_KEYSTORE",
  689. "value": "${HTTPS_KEYSTORE}"
  690. },
  691. {
  692. "name": "HTTPS_KEYSTORE_TYPE",
  693. "value": "${HTTPS_KEYSTORE_TYPE}"
  694. },
  695. {
  696. "name": "HTTPS_NAME",
  697. "value": "${HTTPS_NAME}"
  698. },
  699. {
  700. "name": "HTTPS_PASSWORD",
  701. "value": "${HTTPS_PASSWORD}"
  702. },
  703. {
  704. "name": "MQ_CLUSTER_PASSWORD",
  705. "value": "${MQ_CLUSTER_PASSWORD}"
  706. },
  707. {
  708. "name": "MQ_QUEUES",
  709. "value": "${MQ_QUEUES}"
  710. },
  711. {
  712. "name": "MQ_TOPICS",
  713. "value": "${MQ_TOPICS}"
  714. },
  715. {
  716. "name": "JGROUPS_ENCRYPT_SECRET",
  717. "value": "${JGROUPS_ENCRYPT_SECRET}"
  718. },
  719. {
  720. "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR",
  721. "value": "/etc/jgroups-encrypt-secret-volume"
  722. },
  723. {
  724. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  725. "value": "${JGROUPS_ENCRYPT_KEYSTORE}"
  726. },
  727. {
  728. "name": "JGROUPS_ENCRYPT_NAME",
  729. "value": "${JGROUPS_ENCRYPT_NAME}"
  730. },
  731. {
  732. "name": "JGROUPS_ENCRYPT_PASSWORD",
  733. "value": "${JGROUPS_ENCRYPT_PASSWORD}"
  734. },
  735. {
  736. "name": "JGROUPS_CLUSTER_PASSWORD",
  737. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  738. },
  739. {
  740. "name": "AUTO_DEPLOY_EXPLODED",
  741. "value": "${AUTO_DEPLOY_EXPLODED}"
  742. },
  743. {
  744. "name": "DEFAULT_JOB_REPOSITORY",
  745. "value": "${APPLICATION_NAME}-mysql"
  746. },
  747. {
  748. "name": "TIMER_SERVICE_DATA_STORE",
  749. "value": "${APPLICATION_NAME}-mysql"
  750. }
  751. ]
  752. }
  753. ],
  754. "volumes": [
  755. {
  756. "name": "eap-keystore-volume",
  757. "secret": {
  758. "secretName": "${HTTPS_SECRET}"
  759. }
  760. },
  761. {
  762. "name": "eap-jgroups-keystore-volume",
  763. "secret": {
  764. "secretName": "${JGROUPS_ENCRYPT_SECRET}"
  765. }
  766. }
  767. ]
  768. }
  769. }
  770. }
  771. },
  772. {
  773. "kind": "DeploymentConfig",
  774. "apiVersion": "v1",
  775. "metadata": {
  776. "name": "${APPLICATION_NAME}-mysql",
  777. "labels": {
  778. "application": "${APPLICATION_NAME}"
  779. }
  780. },
  781. "spec": {
  782. "strategy": {
  783. "type": "Recreate"
  784. },
  785. "triggers": [
  786. {
  787. "type": "ImageChange",
  788. "imageChangeParams": {
  789. "automatic": true,
  790. "containerNames": [
  791. "${APPLICATION_NAME}-mysql"
  792. ],
  793. "from": {
  794. "kind": "ImageStreamTag",
  795. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  796. "name": "mysql:${MYSQL_IMAGE_STREAM_TAG}"
  797. }
  798. }
  799. },
  800. {
  801. "type": "ConfigChange"
  802. }
  803. ],
  804. "replicas": 1,
  805. "selector": {
  806. "deploymentConfig": "${APPLICATION_NAME}-mysql"
  807. },
  808. "template": {
  809. "metadata": {
  810. "name": "${APPLICATION_NAME}-mysql",
  811. "labels": {
  812. "deploymentConfig": "${APPLICATION_NAME}-mysql",
  813. "application": "${APPLICATION_NAME}"
  814. }
  815. },
  816. "spec": {
  817. "terminationGracePeriodSeconds": 60,
  818. "containers": [
  819. {
  820. "name": "${APPLICATION_NAME}-mysql",
  821. "image": "mysql",
  822. "imagePullPolicy": "Always",
  823. "ports": [
  824. {
  825. "containerPort": 3306,
  826. "protocol": "TCP"
  827. }
  828. ],
  829. "readinessProbe": {
  830. "timeoutSeconds": 1,
  831. "initialDelaySeconds": 5,
  832. "exec": {
  833. "command": [ "/bin/sh", "-i", "-c",
  834. "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"]
  835. }
  836. },
  837. "livenessProbe": {
  838. "timeoutSeconds": 1,
  839. "initialDelaySeconds": 30,
  840. "tcpSocket": {
  841. "port": 3306
  842. }
  843. },
  844. "volumeMounts": [
  845. {
  846. "mountPath": "/var/lib/mysql/data",
  847. "name": "${APPLICATION_NAME}-mysql-pvol"
  848. }
  849. ],
  850. "env": [
  851. {
  852. "name": "MYSQL_USER",
  853. "value": "${DB_USERNAME}"
  854. },
  855. {
  856. "name": "MYSQL_PASSWORD",
  857. "value": "${DB_PASSWORD}"
  858. },
  859. {
  860. "name": "MYSQL_DATABASE",
  861. "value": "${DB_DATABASE}"
  862. },
  863. {
  864. "name": "MYSQL_LOWER_CASE_TABLE_NAMES",
  865. "value": "${MYSQL_LOWER_CASE_TABLE_NAMES}"
  866. },
  867. {
  868. "name": "MYSQL_MAX_CONNECTIONS",
  869. "value": "${MYSQL_MAX_CONNECTIONS}"
  870. },
  871. {
  872. "name": "MYSQL_FT_MIN_WORD_LEN",
  873. "value": "${MYSQL_FT_MIN_WORD_LEN}"
  874. },
  875. {
  876. "name": "MYSQL_FT_MAX_WORD_LEN",
  877. "value": "${MYSQL_FT_MAX_WORD_LEN}"
  878. },
  879. {
  880. "name": "MYSQL_AIO",
  881. "value": "${MYSQL_AIO}"
  882. }
  883. ]
  884. }
  885. ],
  886. "volumes": [
  887. {
  888. "name": "${APPLICATION_NAME}-mysql-pvol",
  889. "persistentVolumeClaim": {
  890. "claimName": "${APPLICATION_NAME}-mysql-claim"
  891. }
  892. }
  893. ]
  894. }
  895. }
  896. }
  897. },
  898. {
  899. "apiVersion": "v1",
  900. "kind": "PersistentVolumeClaim",
  901. "metadata": {
  902. "name": "${APPLICATION_NAME}-mysql-claim",
  903. "labels": {
  904. "application": "${APPLICATION_NAME}"
  905. }
  906. },
  907. "spec": {
  908. "accessModes": [
  909. "ReadWriteOnce"
  910. ],
  911. "resources": {
  912. "requests": {
  913. "storage": "${VOLUME_CAPACITY}"
  914. }
  915. }
  916. }
  917. }
  918. ]
  919. }