sso70-https.json 23 KB

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