sso70-mysql.json 29 KB

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