sso70-mysql.json 25 KB

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