eap-cd-tx-recovery-s2i.json 24 KB

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