sso71-https.json 23 KB

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