sso70-https.json 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for SSO 7.0",
  7. "iconClass" : "icon-jboss",
  8. "tags" : "sso,keycloak,java,jboss,xpaas",
  9. "version" : "1.3.2"
  10. },
  11. "name": "sso70-https"
  12. },
  13. "labels": {
  14. "template": "sso70-https",
  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": "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.",
  38. "name": "SERVICE_ACCOUNT_NAME",
  39. "value": "sso-service-account",
  40. "required": true
  41. },
  42. {
  43. "description": "The name of the secret containing the keystore file",
  44. "name": "HTTPS_SECRET",
  45. "value": "sso-app-secret",
  46. "required": false
  47. },
  48. {
  49. "description": "The name of the keystore file within the secret",
  50. "name": "HTTPS_KEYSTORE",
  51. "value": "keystore.jks",
  52. "required": false
  53. },
  54. {
  55. "description": "The type of the keystore file (JKS or JCEKS)",
  56. "name": "HTTPS_KEYSTORE_TYPE",
  57. "value": "",
  58. "required": false
  59. },
  60. {
  61. "description": "The name associated with the server certificate (e.g. jboss)",
  62. "name": "HTTPS_NAME",
  63. "value": "",
  64. "required": false
  65. },
  66. {
  67. "description": "The password for the keystore and certificate (e.g. mykeystorepass)",
  68. "name": "HTTPS_PASSWORD",
  69. "value": "",
  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": "The name of the secret containing the keystore file",
  89. "name": "JGROUPS_ENCRYPT_SECRET",
  90. "value": "sso-app-secret",
  91. "required": false
  92. },
  93. {
  94. "description": "The name of the keystore file within the secret",
  95. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  96. "value": "jgroups.jceks",
  97. "required": false
  98. },
  99. {
  100. "description": "The name associated with the server certificate (e.g. secret-key)",
  101. "name": "JGROUPS_ENCRYPT_NAME",
  102. "value": "",
  103. "required": false
  104. },
  105. {
  106. "description": "The password for the keystore and certificate (e.g. password)",
  107. "name": "JGROUPS_ENCRYPT_PASSWORD",
  108. "value": "",
  109. "required": false
  110. },
  111. {
  112. "description": "JGroups cluster password",
  113. "name": "JGROUPS_CLUSTER_PASSWORD",
  114. "from": "[a-zA-Z0-9]{8}",
  115. "generate": "expression",
  116. "required": true
  117. },
  118. {
  119. "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.",
  120. "name": "IMAGE_STREAM_NAMESPACE",
  121. "value": "openshift",
  122. "required": true
  123. },
  124. {
  125. "description": "SSO Server admin username",
  126. "name": "SSO_ADMIN_USERNAME",
  127. "value": "admin",
  128. "required": false
  129. },
  130. {
  131. "description": "SSO Server admin password",
  132. "name": "SSO_ADMIN_PASSWORD",
  133. "value": "admin",
  134. "required": false
  135. },
  136. {
  137. "description": "Realm to be created in the SSO server (e.g. demo).",
  138. "name": "SSO_REALM",
  139. "value": "",
  140. "required": false
  141. },
  142. {
  143. "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.",
  144. "name": "SSO_SERVICE_USERNAME",
  145. "value": "",
  146. "required": false
  147. },
  148. {
  149. "description": "The password for the SSO service user.",
  150. "name": "SSO_SERVICE_PASSWORD",
  151. "value": "",
  152. "required": false
  153. },
  154. {
  155. "description": "The name of the truststore file within the secret (e.g. truststore.jks)",
  156. "name": "SSO_TRUSTSTORE",
  157. "value": "",
  158. "required": false
  159. },
  160. {
  161. "description": "The password for the truststore and certificate (e.g. mykeystorepass)",
  162. "name": "SSO_TRUSTSTORE_PASSWORD",
  163. "value": "",
  164. "required": false
  165. },
  166. {
  167. "description": "The name of the secret containing the truststore file (e.g. truststore-secret). Used for volume secretName",
  168. "name": "SSO_TRUSTSTORE_SECRET",
  169. "value": "sso-app-secret",
  170. "required": false
  171. }
  172. ],
  173. "objects": [
  174. {
  175. "kind": "Service",
  176. "apiVersion": "v1",
  177. "spec": {
  178. "ports": [
  179. {
  180. "port": 8080,
  181. "targetPort": 8080
  182. }
  183. ],
  184. "selector": {
  185. "deploymentConfig": "${APPLICATION_NAME}"
  186. }
  187. },
  188. "metadata": {
  189. "name": "${APPLICATION_NAME}",
  190. "labels": {
  191. "application": "${APPLICATION_NAME}"
  192. },
  193. "annotations": {
  194. "description": "The web server's http port."
  195. }
  196. }
  197. },
  198. {
  199. "kind": "Service",
  200. "apiVersion": "v1",
  201. "spec": {
  202. "ports": [
  203. {
  204. "port": 8443,
  205. "targetPort": 8443
  206. }
  207. ],
  208. "selector": {
  209. "deploymentConfig": "${APPLICATION_NAME}"
  210. }
  211. },
  212. "metadata": {
  213. "name": "secure-${APPLICATION_NAME}",
  214. "labels": {
  215. "application": "${APPLICATION_NAME}"
  216. },
  217. "annotations": {
  218. "description": "The web server's https port."
  219. }
  220. }
  221. },
  222. {
  223. "kind": "Route",
  224. "apiVersion": "v1",
  225. "id": "${APPLICATION_NAME}-http",
  226. "metadata": {
  227. "name": "${APPLICATION_NAME}",
  228. "labels": {
  229. "application": "${APPLICATION_NAME}"
  230. },
  231. "annotations": {
  232. "description": "Route for application's http service."
  233. }
  234. },
  235. "spec": {
  236. "host": "${HOSTNAME_HTTP}",
  237. "to": {
  238. "name": "${APPLICATION_NAME}"
  239. }
  240. }
  241. },
  242. {
  243. "kind": "Route",
  244. "apiVersion": "v1",
  245. "id": "${APPLICATION_NAME}-https",
  246. "metadata": {
  247. "name": "secure-${APPLICATION_NAME}",
  248. "labels": {
  249. "application": "${APPLICATION_NAME}"
  250. },
  251. "annotations": {
  252. "description": "Route for application's https service."
  253. }
  254. },
  255. "spec": {
  256. "host": "${HOSTNAME_HTTPS}",
  257. "to": {
  258. "name": "secure-${APPLICATION_NAME}"
  259. },
  260. "tls": {
  261. "termination": "passthrough"
  262. }
  263. }
  264. },
  265. {
  266. "kind": "DeploymentConfig",
  267. "apiVersion": "v1",
  268. "metadata": {
  269. "name": "${APPLICATION_NAME}",
  270. "labels": {
  271. "application": "${APPLICATION_NAME}"
  272. }
  273. },
  274. "spec": {
  275. "strategy": {
  276. "type": "Recreate"
  277. },
  278. "triggers": [
  279. {
  280. "type": "ImageChange",
  281. "imageChangeParams": {
  282. "automatic": true,
  283. "containerNames": [
  284. "${APPLICATION_NAME}"
  285. ],
  286. "from": {
  287. "kind": "ImageStreamTag",
  288. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  289. "name": "redhat-sso70-openshift:1.3"
  290. }
  291. }
  292. },
  293. {
  294. "type": "ConfigChange"
  295. }
  296. ],
  297. "replicas": 1,
  298. "selector": {
  299. "deploymentConfig": "${APPLICATION_NAME}"
  300. },
  301. "template": {
  302. "metadata": {
  303. "name": "${APPLICATION_NAME}",
  304. "labels": {
  305. "deploymentConfig": "${APPLICATION_NAME}",
  306. "application": "${APPLICATION_NAME}"
  307. }
  308. },
  309. "spec": {
  310. "serviceAccountName": "${SERVICE_ACCOUNT_NAME}",
  311. "terminationGracePeriodSeconds": 75,
  312. "containers": [
  313. {
  314. "name": "${APPLICATION_NAME}",
  315. "image": "${APPLICATION_NAME}",
  316. "imagePullPolicy": "Always",
  317. "volumeMounts": [
  318. {
  319. "name": "eap-keystore-volume",
  320. "mountPath": "/etc/eap-secret-volume",
  321. "readOnly": true
  322. },
  323. {
  324. "name": "eap-jgroups-keystore-volume",
  325. "mountPath": "/etc/jgroups-encrypt-secret-volume",
  326. "readOnly": true
  327. },
  328. {
  329. "name": "sso-truststore-volume",
  330. "mountPath": "/etc/sso-secret-volume",
  331. "readOnly": true
  332. }
  333. ],
  334. "lifecycle": {
  335. "preStop": {
  336. "exec": {
  337. "command": [
  338. "/opt/eap/bin/jboss-cli.sh",
  339. "-c",
  340. ":shutdown(timeout=60)"
  341. ]
  342. }
  343. }
  344. },
  345. "livenessProbe": {
  346. "exec": {
  347. "command": [
  348. "/bin/bash",
  349. "-c",
  350. "/opt/eap/bin/livenessProbe.sh"
  351. ]
  352. }
  353. },
  354. "readinessProbe": {
  355. "exec": {
  356. "command": [
  357. "/bin/bash",
  358. "-c",
  359. "/opt/eap/bin/readinessProbe.sh"
  360. ]
  361. }
  362. },
  363. "ports": [
  364. {
  365. "name": "jolokia",
  366. "containerPort": 8778,
  367. "protocol": "TCP"
  368. },
  369. {
  370. "name": "http",
  371. "containerPort": 8080,
  372. "protocol": "TCP"
  373. },
  374. {
  375. "name": "https",
  376. "containerPort": 8443,
  377. "protocol": "TCP"
  378. },
  379. {
  380. "name": "ping",
  381. "containerPort": 8888,
  382. "protocol": "TCP"
  383. }
  384. ],
  385. "env": [
  386. {
  387. "name": "DB_MIN_POOL_SIZE",
  388. "value": "${DB_MIN_POOL_SIZE}"
  389. },
  390. {
  391. "name": "DB_MAX_POOL_SIZE",
  392. "value": "${DB_MAX_POOL_SIZE}"
  393. },
  394. {
  395. "name": "DB_TX_ISOLATION",
  396. "value": "${DB_TX_ISOLATION}"
  397. },
  398. {
  399. "name": "OPENSHIFT_KUBE_PING_LABELS",
  400. "value": "application=${APPLICATION_NAME}"
  401. },
  402. {
  403. "name": "OPENSHIFT_KUBE_PING_NAMESPACE",
  404. "valueFrom": {
  405. "fieldRef": {
  406. "fieldPath": "metadata.namespace"
  407. }
  408. }
  409. },
  410. {
  411. "name": "HTTPS_KEYSTORE_DIR",
  412. "value": "/etc/eap-secret-volume"
  413. },
  414. {
  415. "name": "HTTPS_KEYSTORE",
  416. "value": "${HTTPS_KEYSTORE}"
  417. },
  418. {
  419. "name": "HTTPS_KEYSTORE_TYPE",
  420. "value": "${HTTPS_KEYSTORE_TYPE}"
  421. },
  422. {
  423. "name": "HTTPS_NAME",
  424. "value": "${HTTPS_NAME}"
  425. },
  426. {
  427. "name": "HTTPS_PASSWORD",
  428. "value": "${HTTPS_PASSWORD}"
  429. },
  430. {
  431. "name": "JGROUPS_ENCRYPT_SECRET",
  432. "value": "${JGROUPS_ENCRYPT_SECRET}"
  433. },
  434. {
  435. "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR",
  436. "value": "/etc/jgroups-encrypt-secret-volume"
  437. },
  438. {
  439. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  440. "value": "${JGROUPS_ENCRYPT_KEYSTORE}"
  441. },
  442. {
  443. "name": "JGROUPS_ENCRYPT_NAME",
  444. "value": "${JGROUPS_ENCRYPT_NAME}"
  445. },
  446. {
  447. "name": "JGROUPS_ENCRYPT_PASSWORD",
  448. "value": "${JGROUPS_ENCRYPT_PASSWORD}"
  449. },
  450. {
  451. "name": "JGROUPS_CLUSTER_PASSWORD",
  452. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  453. },
  454. {
  455. "name": "SSO_ADMIN_USERNAME",
  456. "value": "${SSO_ADMIN_USERNAME}"
  457. },
  458. {
  459. "name": "SSO_ADMIN_PASSWORD",
  460. "value": "${SSO_ADMIN_PASSWORD}"
  461. },
  462. {
  463. "name": "SSO_REALM",
  464. "value": "${SSO_REALM}"
  465. },
  466. {
  467. "name": "SSO_SERVICE_USERNAME",
  468. "value": "${SSO_SERVICE_USERNAME}"
  469. },
  470. {
  471. "name": "SSO_SERVICE_PASSWORD",
  472. "value": "${SSO_SERVICE_PASSWORD}"
  473. },
  474. {
  475. "name": "SSO_TRUSTSTORE",
  476. "value": "${SSO_TRUSTSTORE}"
  477. },
  478. {
  479. "name": "SSO_TRUSTSTORE_DIR",
  480. "value": "/etc/sso-secret-volume"
  481. },
  482. {
  483. "name": "SSO_TRUSTSTORE_PASSWORD",
  484. "value": "${SSO_TRUSTSTORE_PASSWORD}"
  485. }
  486. ]
  487. }
  488. ],
  489. "volumes": [
  490. {
  491. "name": "eap-keystore-volume",
  492. "secret": {
  493. "secretName": "${HTTPS_SECRET}"
  494. }
  495. },
  496. {
  497. "name": "eap-jgroups-keystore-volume",
  498. "secret": {
  499. "secretName": "${JGROUPS_ENCRYPT_SECRET}"
  500. }
  501. },
  502. {
  503. "name": "sso-truststore-volume",
  504. "secret": {
  505. "secretName": "${SSO_TRUSTSTORE_SECRET}"
  506. }
  507. }
  508. ]
  509. }
  510. }
  511. }
  512. }
  513. ]
  514. }