eap-cd-https-s2i.json 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "iconClass": "icon-eap",
  7. "tags": "eap,javaee,java,jboss,hidden",
  8. "version": "1.5.0",
  9. "openshift.io/display-name": "JBoss EAP CD (with https)",
  10. "openshift.io/provider-display-name": "Red Hat, Inc.",
  11. "description": "An example JBoss Enterprise Application Platform continuous delivery application configured with secure communication using HTTPS. For more information about using this template, see https://github.com/jboss-container-images/jboss-eap-7-openshift-image/blob/eap-cd/README.adoc",
  12. "template.openshift.io/long-description": "This template defines resources needed to develop a JBoss Enterprise Application Platform continuous delivery application, including a build configuration, application deployment configuration and secure communication using https.",
  13. "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/",
  14. "template.openshift.io/support-url": "https://access.redhat.com"
  15. },
  16. "name": "eap-cd-https-s2i"
  17. },
  18. "labels": {
  19. "template": "eap-cd-https-s2i",
  20. "xpaas": "1.5.0"
  21. },
  22. "message": "A new JBoss EAP CD based application with SSL support has been created in your project. Please be sure to create 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.",
  23. "parameters": [
  24. {
  25. "displayName": "Application Name",
  26. "description": "The name for the application.",
  27. "name": "APPLICATION_NAME",
  28. "value": "eap-app",
  29. "required": true
  30. },
  31. {
  32. "displayName": "Custom https Route Hostname",
  33. "description": "Custom hostname for https service route. Leave blank for default hostname, e.g.: secure-<application-name>-<project>.<default-domain-suffix>",
  34. "name": "HOSTNAME_HTTPS",
  35. "value": "",
  36. "required": false
  37. },
  38. {
  39. "displayName": "Git Repository URL",
  40. "description": "Git source URI for application",
  41. "name": "SOURCE_REPOSITORY_URL",
  42. "value": "https://github.com/jboss-developer/jboss-eap-quickstarts.git",
  43. "required": true
  44. },
  45. {
  46. "displayName": "Git Reference",
  47. "description": "Git branch/tag reference",
  48. "name": "SOURCE_REPOSITORY_REF",
  49. "value": "openshift",
  50. "required": false
  51. },
  52. {
  53. "displayName": "Context Directory",
  54. "description": "Path within Git project to build; empty for root project directory.",
  55. "name": "CONTEXT_DIR",
  56. "value": "kitchensink",
  57. "required": false
  58. },
  59. {
  60. "displayName": "Queues",
  61. "description": "Queue names, separated by commas. These queues will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all queues used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.",
  62. "name": "MQ_QUEUES",
  63. "value": "",
  64. "required": false
  65. },
  66. {
  67. "displayName": "Topics",
  68. "description": "Topic names, separated by commas. These topics will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all topics used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.",
  69. "name": "MQ_TOPICS",
  70. "value": "",
  71. "required": false
  72. },
  73. {
  74. "displayName": "Server Keystore Secret Name",
  75. "description": "The name of the secret containing the keystore file",
  76. "name": "HTTPS_SECRET",
  77. "value": "eap7-app-secret",
  78. "required": true
  79. },
  80. {
  81. "displayName": "Server Keystore Filename",
  82. "description": "The name of the keystore file within the secret",
  83. "name": "HTTPS_KEYSTORE",
  84. "value": "keystore.jks",
  85. "required": false
  86. },
  87. {
  88. "displayName": "Server Keystore Type",
  89. "description": "The type of the keystore file (JKS or JCEKS)",
  90. "name": "HTTPS_KEYSTORE_TYPE",
  91. "value": "",
  92. "required": false
  93. },
  94. {
  95. "displayName": "Server Certificate Name",
  96. "description": "The name associated with the server certificate",
  97. "name": "HTTPS_NAME",
  98. "value": "",
  99. "required": false
  100. },
  101. {
  102. "displayName": "Server Keystore Password",
  103. "description": "The password for the keystore and certificate",
  104. "name": "HTTPS_PASSWORD",
  105. "value": "",
  106. "required": false
  107. },
  108. {
  109. "displayName": "AMQ cluster password",
  110. "description": "AMQ cluster admin password",
  111. "name": "MQ_CLUSTER_PASSWORD",
  112. "from": "[a-zA-Z0-9]{8}",
  113. "generate": "expression",
  114. "required": true
  115. },
  116. {
  117. "displayName": "Github Webhook Secret",
  118. "description": "GitHub trigger secret",
  119. "name": "GITHUB_WEBHOOK_SECRET",
  120. "from": "[a-zA-Z0-9]{8}",
  121. "generate": "expression",
  122. "required": true
  123. },
  124. {
  125. "displayName": "Generic Webhook Secret",
  126. "description": "Generic build trigger secret",
  127. "name": "GENERIC_WEBHOOK_SECRET",
  128. "from": "[a-zA-Z0-9]{8}",
  129. "generate": "expression",
  130. "required": true
  131. },
  132. {
  133. "displayName": "ImageStream Namespace",
  134. "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.",
  135. "name": "IMAGE_STREAM_NAMESPACE",
  136. "value": "openshift",
  137. "required": true
  138. },
  139. {
  140. "displayName": "JGroups Secret Name",
  141. "description": "The name of the secret containing the keystore file",
  142. "name": "JGROUPS_ENCRYPT_SECRET",
  143. "value": "eap7-app-secret",
  144. "required": false
  145. },
  146. {
  147. "displayName": "JGroups Keystore Filename",
  148. "description": "The name of the keystore file within the secret",
  149. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  150. "value": "jgroups.jceks",
  151. "required": false
  152. },
  153. {
  154. "displayName": "JGroups Certificate Name",
  155. "description": "The name associated with the server certificate",
  156. "name": "JGROUPS_ENCRYPT_NAME",
  157. "value": "",
  158. "required": false
  159. },
  160. {
  161. "displayName": "JGroups Keystore Password",
  162. "description": "The password for the keystore and certificate",
  163. "name": "JGROUPS_ENCRYPT_PASSWORD",
  164. "value": "",
  165. "required": false
  166. },
  167. {
  168. "displayName": "JGroups Cluster Password",
  169. "description": "JGroups cluster password",
  170. "name": "JGROUPS_CLUSTER_PASSWORD",
  171. "from": "[a-zA-Z0-9]{8}",
  172. "generate": "expression",
  173. "required": true
  174. },
  175. {
  176. "displayName": "Deploy Exploded Archives",
  177. "description": "Controls whether exploded deployment content should be automatically deployed",
  178. "name": "AUTO_DEPLOY_EXPLODED",
  179. "value": "false",
  180. "required": false
  181. },
  182. {
  183. "displayName": "Maven mirror URL",
  184. "description": "Maven mirror to use for S2I builds",
  185. "name": "MAVEN_MIRROR_URL",
  186. "value": "",
  187. "required": false
  188. },
  189. {
  190. "displayName": "Maven Additional Arguments",
  191. "description": "Maven additional arguments to use for S2I builds",
  192. "name": "MAVEN_ARGS_APPEND",
  193. "value": "-Dcom.redhat.xpaas.repo.jbossorg",
  194. "required": false
  195. },
  196. {
  197. "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.",
  198. "name": "ARTIFACT_DIR",
  199. "value": "",
  200. "required": false
  201. },
  202. {
  203. "description": "Container memory limit",
  204. "name": "MEMORY_LIMIT",
  205. "value": "1Gi",
  206. "required": false
  207. }
  208. ],
  209. "objects": [
  210. {
  211. "kind": "Service",
  212. "apiVersion": "v1",
  213. "spec": {
  214. "ports": [
  215. {
  216. "port": 8080,
  217. "targetPort": 8080
  218. }
  219. ],
  220. "selector": {
  221. "deploymentConfig": "${APPLICATION_NAME}"
  222. }
  223. },
  224. "metadata": {
  225. "name": "${APPLICATION_NAME}",
  226. "labels": {
  227. "application": "${APPLICATION_NAME}"
  228. },
  229. "annotations": {
  230. "description": "The web server's http port."
  231. }
  232. }
  233. },
  234. {
  235. "kind": "Service",
  236. "apiVersion": "v1",
  237. "spec": {
  238. "ports": [
  239. {
  240. "port": 8443,
  241. "targetPort": 8443
  242. }
  243. ],
  244. "selector": {
  245. "deploymentConfig": "${APPLICATION_NAME}"
  246. }
  247. },
  248. "metadata": {
  249. "name": "secure-${APPLICATION_NAME}",
  250. "labels": {
  251. "application": "${APPLICATION_NAME}"
  252. },
  253. "annotations": {
  254. "description": "The web server's https port."
  255. }
  256. }
  257. },
  258. {
  259. "kind": "Service",
  260. "apiVersion": "v1",
  261. "spec": {
  262. "clusterIP": "None",
  263. "ports": [
  264. {
  265. "name": "ping",
  266. "port": 8888
  267. }
  268. ],
  269. "selector": {
  270. "deploymentConfig": "${APPLICATION_NAME}"
  271. }
  272. },
  273. "metadata": {
  274. "name": "${APPLICATION_NAME}-ping",
  275. "labels": {
  276. "application": "${APPLICATION_NAME}"
  277. },
  278. "annotations": {
  279. "service.alpha.kubernetes.io/tolerate-unready-endpoints": "true",
  280. "description": "The JGroups ping port for clustering."
  281. }
  282. }
  283. },
  284. {
  285. "kind": "Route",
  286. "apiVersion": "v1",
  287. "id": "${APPLICATION_NAME}-http",
  288. "metadata": {
  289. "name": "${APPLICATION_NAME}",
  290. "labels": {
  291. "application": "${APPLICATION_NAME}"
  292. },
  293. "annotations": {
  294. "description": "Route for application's http service."
  295. }
  296. },
  297. "spec": {
  298. "to": {
  299. "name": "${APPLICATION_NAME}"
  300. }
  301. }
  302. },
  303. {
  304. "kind": "Route",
  305. "apiVersion": "v1",
  306. "id": "${APPLICATION_NAME}-https",
  307. "metadata": {
  308. "name": "secure-${APPLICATION_NAME}",
  309. "labels": {
  310. "application": "${APPLICATION_NAME}"
  311. },
  312. "annotations": {
  313. "description": "Route for application's https service."
  314. }
  315. },
  316. "spec": {
  317. "host": "${HOSTNAME_HTTPS}",
  318. "to": {
  319. "name": "secure-${APPLICATION_NAME}"
  320. },
  321. "tls": {
  322. "termination": "passthrough"
  323. }
  324. }
  325. },
  326. {
  327. "kind": "ImageStream",
  328. "apiVersion": "v1",
  329. "metadata": {
  330. "name": "${APPLICATION_NAME}",
  331. "labels": {
  332. "application": "${APPLICATION_NAME}"
  333. }
  334. }
  335. },
  336. {
  337. "kind": "BuildConfig",
  338. "apiVersion": "v1",
  339. "metadata": {
  340. "name": "${APPLICATION_NAME}",
  341. "labels": {
  342. "application": "${APPLICATION_NAME}"
  343. }
  344. },
  345. "spec": {
  346. "source": {
  347. "type": "Git",
  348. "git": {
  349. "uri": "${SOURCE_REPOSITORY_URL}",
  350. "ref": "${SOURCE_REPOSITORY_REF}"
  351. },
  352. "contextDir": "${CONTEXT_DIR}"
  353. },
  354. "strategy": {
  355. "type": "Source",
  356. "sourceStrategy": {
  357. "env": [
  358. {
  359. "name": "MAVEN_MIRROR_URL",
  360. "value": "${MAVEN_MIRROR_URL}"
  361. },
  362. {
  363. "name": "MAVEN_ARGS_APPEND",
  364. "value": "${MAVEN_ARGS_APPEND}"
  365. },
  366. {
  367. "name": "ARTIFACT_DIR",
  368. "value": "${ARTIFACT_DIR}"
  369. }
  370. ],
  371. "forcePull": true,
  372. "from": {
  373. "kind": "ImageStreamTag",
  374. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  375. "name": "eap-cd-openshift:13"
  376. }
  377. }
  378. },
  379. "output": {
  380. "to": {
  381. "kind": "ImageStreamTag",
  382. "name": "${APPLICATION_NAME}:latest"
  383. }
  384. },
  385. "triggers": [
  386. {
  387. "type": "GitHub",
  388. "github": {
  389. "secret": "${GITHUB_WEBHOOK_SECRET}"
  390. }
  391. },
  392. {
  393. "type": "Generic",
  394. "generic": {
  395. "secret": "${GENERIC_WEBHOOK_SECRET}"
  396. }
  397. },
  398. {
  399. "type": "ImageChange",
  400. "imageChange": {}
  401. },
  402. {
  403. "type": "ConfigChange"
  404. }
  405. ]
  406. }
  407. },
  408. {
  409. "kind": "DeploymentConfig",
  410. "apiVersion": "v1",
  411. "metadata": {
  412. "name": "${APPLICATION_NAME}",
  413. "labels": {
  414. "application": "${APPLICATION_NAME}"
  415. }
  416. },
  417. "spec": {
  418. "strategy": {
  419. "type": "Recreate"
  420. },
  421. "triggers": [
  422. {
  423. "type": "ImageChange",
  424. "imageChangeParams": {
  425. "automatic": true,
  426. "containerNames": [
  427. "${APPLICATION_NAME}"
  428. ],
  429. "from": {
  430. "kind": "ImageStreamTag",
  431. "name": "${APPLICATION_NAME}:latest"
  432. }
  433. }
  434. },
  435. {
  436. "type": "ConfigChange"
  437. }
  438. ],
  439. "replicas": 1,
  440. "selector": {
  441. "deploymentConfig": "${APPLICATION_NAME}"
  442. },
  443. "template": {
  444. "metadata": {
  445. "name": "${APPLICATION_NAME}",
  446. "labels": {
  447. "deploymentConfig": "${APPLICATION_NAME}",
  448. "application": "${APPLICATION_NAME}"
  449. }
  450. },
  451. "spec": {
  452. "terminationGracePeriodSeconds": 75,
  453. "containers": [
  454. {
  455. "name": "${APPLICATION_NAME}",
  456. "image": "${APPLICATION_NAME}",
  457. "imagePullPolicy": "Always",
  458. "resources": {
  459. "limits": {
  460. "memory": "${MEMORY_LIMIT}"
  461. }
  462. },
  463. "volumeMounts": [
  464. {
  465. "name": "eap-keystore-volume",
  466. "mountPath": "/etc/eap-secret-volume",
  467. "readOnly": true
  468. },
  469. {
  470. "name": "eap-jgroups-keystore-volume",
  471. "mountPath": "/etc/jgroups-encrypt-secret-volume",
  472. "readOnly": true
  473. }
  474. ],
  475. "livenessProbe": {
  476. "exec": {
  477. "command": [
  478. "/bin/bash",
  479. "-c",
  480. "/opt/eap/bin/livenessProbe.sh"
  481. ]
  482. },
  483. "initialDelaySeconds": 60
  484. },
  485. "readinessProbe": {
  486. "exec": {
  487. "command": [
  488. "/bin/bash",
  489. "-c",
  490. "/opt/eap/bin/readinessProbe.sh"
  491. ]
  492. }
  493. },
  494. "ports": [
  495. {
  496. "name": "jolokia",
  497. "containerPort": 8778,
  498. "protocol": "TCP"
  499. },
  500. {
  501. "name": "http",
  502. "containerPort": 8080,
  503. "protocol": "TCP"
  504. },
  505. {
  506. "name": "https",
  507. "containerPort": 8443,
  508. "protocol": "TCP"
  509. },
  510. {
  511. "name": "ping",
  512. "containerPort": 8888,
  513. "protocol": "TCP"
  514. }
  515. ],
  516. "env": [
  517. {
  518. "name": "JGROUPS_PING_PROTOCOL",
  519. "value": "openshift.DNS_PING"
  520. },
  521. {
  522. "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
  523. "value": "${APPLICATION_NAME}-ping"
  524. },
  525. {
  526. "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
  527. "value": "8888"
  528. },
  529. {
  530. "name": "HTTPS_KEYSTORE_DIR",
  531. "value": "/etc/eap-secret-volume"
  532. },
  533. {
  534. "name": "HTTPS_KEYSTORE",
  535. "value": "${HTTPS_KEYSTORE}"
  536. },
  537. {
  538. "name": "HTTPS_KEYSTORE_TYPE",
  539. "value": "${HTTPS_KEYSTORE_TYPE}"
  540. },
  541. {
  542. "name": "HTTPS_NAME",
  543. "value": "${HTTPS_NAME}"
  544. },
  545. {
  546. "name": "HTTPS_PASSWORD",
  547. "value": "${HTTPS_PASSWORD}"
  548. },
  549. {
  550. "name": "MQ_CLUSTER_PASSWORD",
  551. "value": "${MQ_CLUSTER_PASSWORD}"
  552. },
  553. {
  554. "name": "MQ_QUEUES",
  555. "value": "${MQ_QUEUES}"
  556. },
  557. {
  558. "name": "MQ_TOPICS",
  559. "value": "${MQ_TOPICS}"
  560. },
  561. {
  562. "name": "JGROUPS_ENCRYPT_SECRET",
  563. "value": "${JGROUPS_ENCRYPT_SECRET}"
  564. },
  565. {
  566. "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR",
  567. "value": "/etc/jgroups-encrypt-secret-volume"
  568. },
  569. {
  570. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  571. "value": "${JGROUPS_ENCRYPT_KEYSTORE}"
  572. },
  573. {
  574. "name": "JGROUPS_ENCRYPT_NAME",
  575. "value": "${JGROUPS_ENCRYPT_NAME}"
  576. },
  577. {
  578. "name": "JGROUPS_ENCRYPT_PASSWORD",
  579. "value": "${JGROUPS_ENCRYPT_PASSWORD}"
  580. },
  581. {
  582. "name": "JGROUPS_CLUSTER_PASSWORD",
  583. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  584. },
  585. {
  586. "name": "AUTO_DEPLOY_EXPLODED",
  587. "value": "${AUTO_DEPLOY_EXPLODED}"
  588. }
  589. ]
  590. }
  591. ],
  592. "volumes": [
  593. {
  594. "name": "eap-keystore-volume",
  595. "secret": {
  596. "secretName": "${HTTPS_SECRET}"
  597. }
  598. },
  599. {
  600. "name": "eap-jgroups-keystore-volume",
  601. "secret": {
  602. "secretName": "${JGROUPS_ENCRYPT_SECRET}"
  603. }
  604. }
  605. ]
  606. }
  607. }
  608. }
  609. }
  610. ]
  611. }