eap64-amq-persistent-s2i.json 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for EAP 6 A-MQ applications with persistent storage built using S2I.",
  7. "iconClass": "icon-jboss",
  8. "tags": "eap,amq,javaee,java,messaging,jboss,xpaas",
  9. "version": "1.2.0"
  10. },
  11. "name": "eap64-amq-persistent-s2i"
  12. },
  13. "labels": {
  14. "template": "eap64-amq-persistent-s2i",
  15. "xpaas": "1.2.0"
  16. },
  17. "parameters": [
  18. {
  19. "description": "The name for the application.",
  20. "name": "APPLICATION_NAME",
  21. "value": "eap-app",
  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.: secure-<application-name>-<project>.<default-domain-suffix>",
  32. "name": "HOSTNAME_HTTPS",
  33. "value": "",
  34. "required": false
  35. },
  36. {
  37. "description": "Git source URI for application",
  38. "name": "SOURCE_REPOSITORY_URL",
  39. "value": "https://github.com/jboss-developer/jboss-eap-quickstarts.git",
  40. "required": true
  41. },
  42. {
  43. "description": "Git branch/tag reference",
  44. "name": "SOURCE_REPOSITORY_REF",
  45. "value": "6.4.x",
  46. "required": false
  47. },
  48. {
  49. "description": "Path within Git project to build; empty for root project directory.",
  50. "name": "CONTEXT_DIR",
  51. "value": "helloworld-mdb",
  52. "required": false
  53. },
  54. {
  55. "description": "Size of persistent storage for database volume.",
  56. "name": "VOLUME_CAPACITY",
  57. "value": "512Mi",
  58. "required": true
  59. },
  60. {
  61. "description": "JNDI name for connection factory used by applications to connect to the broker, e.g. java:/ConnectionFactory",
  62. "name": "MQ_JNDI",
  63. "value": "java:/ConnectionFactory",
  64. "required": false
  65. },
  66. {
  67. "description": "Broker protocols to configure, separated by commas. Allowed values are: `openwire`, `amqp`, `stomp` and `mqtt`. Only `openwire` is supported by EAP.",
  68. "name": "MQ_PROTOCOL",
  69. "value": "openwire",
  70. "required": false
  71. },
  72. {
  73. "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.",
  74. "name": "MQ_QUEUES",
  75. "value": "HELLOWORLDMDBQueue",
  76. "required": false
  77. },
  78. {
  79. "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.",
  80. "name": "MQ_TOPICS",
  81. "value": "HELLOWORLDMDBTopic",
  82. "required": false
  83. },
  84. {
  85. "description": "The name of the secret containing the keystore file",
  86. "name": "HTTPS_SECRET",
  87. "value": "eap-app-secret",
  88. "required": false
  89. },
  90. {
  91. "description": "The name of the keystore file within the secret",
  92. "name": "HTTPS_KEYSTORE",
  93. "value": "keystore.jks",
  94. "required": false
  95. },
  96. {
  97. "description": "The name associated with the server certificate",
  98. "name": "HTTPS_NAME",
  99. "value": "",
  100. "required": false
  101. },
  102. {
  103. "description": "The password for the keystore and certificate",
  104. "name": "HTTPS_PASSWORD",
  105. "value": "",
  106. "required": false
  107. },
  108. {
  109. "description": "User name for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  110. "name": "MQ_USERNAME",
  111. "from": "user[a-zA-Z0-9]{3}",
  112. "generate": "expression",
  113. "required": false
  114. },
  115. {
  116. "description": "Password for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  117. "name": "MQ_PASSWORD",
  118. "from": "[a-zA-Z0-9]{8}",
  119. "generate": "expression",
  120. "required": false
  121. },
  122. {
  123. "description": "User name for broker admin. If left empty, it will be generated.",
  124. "name": "AMQ_ADMIN_USERNAME",
  125. "from": "user[a-zA-Z0-9]{3}",
  126. "generate": "expression",
  127. "required": true
  128. },
  129. {
  130. "description": "Password for broker admin. If left empty, it will be generated.",
  131. "name": "AMQ_ADMIN_PASSWORD",
  132. "from": "[a-zA-Z0-9]{8}",
  133. "generate": "expression",
  134. "required": true
  135. },
  136. {
  137. "description": "GitHub trigger secret",
  138. "name": "GITHUB_WEBHOOK_SECRET",
  139. "from": "[a-zA-Z0-9]{8}",
  140. "generate": "expression",
  141. "required": true
  142. },
  143. {
  144. "description": "Generic build trigger secret",
  145. "name": "GENERIC_WEBHOOK_SECRET",
  146. "from": "[a-zA-Z0-9]{8}",
  147. "generate": "expression",
  148. "required": true
  149. },
  150. {
  151. "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.",
  152. "name": "IMAGE_STREAM_NAMESPACE",
  153. "value": "openshift",
  154. "required": true
  155. },
  156. {
  157. "description": "The name of the secret containing the keystore file",
  158. "name": "JGROUPS_ENCRYPT_SECRET",
  159. "value": "eap-app-secret",
  160. "required": false
  161. },
  162. {
  163. "description": "The name of the keystore file within the secret",
  164. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  165. "value": "jgroups.jceks",
  166. "required": false
  167. },
  168. {
  169. "description": "The name associated with the server certificate",
  170. "name": "JGROUPS_ENCRYPT_NAME",
  171. "value": "",
  172. "required": false
  173. },
  174. {
  175. "description": "The password for the keystore and certificate",
  176. "name": "JGROUPS_ENCRYPT_PASSWORD",
  177. "value": "",
  178. "required": false
  179. },
  180. {
  181. "description": "JGroups cluster password",
  182. "name": "JGROUPS_CLUSTER_PASSWORD",
  183. "from": "[a-zA-Z0-9]{8}",
  184. "generate": "expression",
  185. "required": true
  186. }
  187. ],
  188. "objects": [
  189. {
  190. "kind": "Service",
  191. "apiVersion": "v1",
  192. "spec": {
  193. "ports": [
  194. {
  195. "port": 8080,
  196. "targetPort": 8080
  197. }
  198. ],
  199. "selector": {
  200. "deploymentConfig": "${APPLICATION_NAME}"
  201. }
  202. },
  203. "metadata": {
  204. "name": "${APPLICATION_NAME}",
  205. "labels": {
  206. "application": "${APPLICATION_NAME}"
  207. },
  208. "annotations": {
  209. "description": "The web server's HTTP port."
  210. }
  211. }
  212. },
  213. {
  214. "kind": "Service",
  215. "apiVersion": "v1",
  216. "spec": {
  217. "ports": [
  218. {
  219. "port": 8443,
  220. "targetPort": 8443
  221. }
  222. ],
  223. "selector": {
  224. "deploymentConfig": "${APPLICATION_NAME}"
  225. }
  226. },
  227. "metadata": {
  228. "name": "secure-${APPLICATION_NAME}",
  229. "labels": {
  230. "application": "${APPLICATION_NAME}"
  231. },
  232. "annotations": {
  233. "description": "The web server's HTTPS port."
  234. }
  235. }
  236. },
  237. {
  238. "kind": "Service",
  239. "apiVersion": "v1",
  240. "spec": {
  241. "ports": [
  242. {
  243. "port": 61616,
  244. "targetPort": 61616
  245. }
  246. ],
  247. "selector": {
  248. "deploymentConfig": "${APPLICATION_NAME}-amq"
  249. }
  250. },
  251. "metadata": {
  252. "name": "${APPLICATION_NAME}-amq-tcp",
  253. "labels": {
  254. "application": "${APPLICATION_NAME}"
  255. },
  256. "annotations": {
  257. "description": "The broker's OpenWire port."
  258. }
  259. }
  260. },
  261. {
  262. "kind": "Route",
  263. "apiVersion": "v1",
  264. "id": "${APPLICATION_NAME}-http",
  265. "metadata": {
  266. "name": "${APPLICATION_NAME}",
  267. "labels": {
  268. "application": "${APPLICATION_NAME}"
  269. },
  270. "annotations": {
  271. "description": "Route for application's HTTP service."
  272. }
  273. },
  274. "spec": {
  275. "host": "${HOSTNAME_HTTP}",
  276. "to": {
  277. "name": "${APPLICATION_NAME}"
  278. }
  279. }
  280. },
  281. {
  282. "kind": "Route",
  283. "apiVersion": "v1",
  284. "id": "${APPLICATION_NAME}-https",
  285. "metadata": {
  286. "name": "secure-${APPLICATION_NAME}",
  287. "labels": {
  288. "application": "${APPLICATION_NAME}"
  289. },
  290. "annotations": {
  291. "description": "Route for application's HTTPS service."
  292. }
  293. },
  294. "spec": {
  295. "host": "${HOSTNAME_HTTPS}",
  296. "to": {
  297. "name": "secure-${APPLICATION_NAME}"
  298. },
  299. "tls": {
  300. "termination": "passthrough"
  301. }
  302. }
  303. },
  304. {
  305. "kind": "ImageStream",
  306. "apiVersion": "v1",
  307. "metadata": {
  308. "name": "${APPLICATION_NAME}",
  309. "labels": {
  310. "application": "${APPLICATION_NAME}"
  311. }
  312. }
  313. },
  314. {
  315. "kind": "BuildConfig",
  316. "apiVersion": "v1",
  317. "metadata": {
  318. "name": "${APPLICATION_NAME}",
  319. "labels": {
  320. "application": "${APPLICATION_NAME}"
  321. }
  322. },
  323. "spec": {
  324. "source": {
  325. "type": "Git",
  326. "git": {
  327. "uri": "${SOURCE_REPOSITORY_URL}",
  328. "ref": "${SOURCE_REPOSITORY_REF}"
  329. },
  330. "contextDir": "${CONTEXT_DIR}"
  331. },
  332. "strategy": {
  333. "type": "Source",
  334. "sourceStrategy": {
  335. "forcePull": true,
  336. "from": {
  337. "kind": "ImageStreamTag",
  338. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  339. "name": "jboss-eap64-openshift:1.2"
  340. }
  341. }
  342. },
  343. "output": {
  344. "to": {
  345. "kind": "ImageStreamTag",
  346. "name": "${APPLICATION_NAME}:latest"
  347. }
  348. },
  349. "triggers": [
  350. {
  351. "type": "GitHub",
  352. "github": {
  353. "secret": "${GITHUB_WEBHOOK_SECRET}"
  354. }
  355. },
  356. {
  357. "type": "Generic",
  358. "generic": {
  359. "secret": "${GENERIC_WEBHOOK_SECRET}"
  360. }
  361. },
  362. {
  363. "type": "ImageChange",
  364. "imageChange": {}
  365. },
  366. {
  367. "type": "ConfigChange"
  368. }
  369. ]
  370. }
  371. },
  372. {
  373. "kind": "DeploymentConfig",
  374. "apiVersion": "v1",
  375. "metadata": {
  376. "name": "${APPLICATION_NAME}",
  377. "labels": {
  378. "application": "${APPLICATION_NAME}"
  379. }
  380. },
  381. "spec": {
  382. "strategy": {
  383. "type": "Recreate"
  384. },
  385. "triggers": [
  386. {
  387. "type": "ImageChange",
  388. "imageChangeParams": {
  389. "automatic": true,
  390. "containerNames": [
  391. "${APPLICATION_NAME}"
  392. ],
  393. "from": {
  394. "kind": "ImageStream",
  395. "name": "${APPLICATION_NAME}"
  396. }
  397. }
  398. },
  399. {
  400. "type": "ConfigChange"
  401. }
  402. ],
  403. "replicas": 1,
  404. "selector": {
  405. "deploymentConfig": "${APPLICATION_NAME}"
  406. },
  407. "template": {
  408. "metadata": {
  409. "name": "${APPLICATION_NAME}",
  410. "labels": {
  411. "deploymentConfig": "${APPLICATION_NAME}",
  412. "application": "${APPLICATION_NAME}"
  413. }
  414. },
  415. "spec": {
  416. "serviceAccount": "eap-service-account",
  417. "terminationGracePeriodSeconds": 60,
  418. "containers": [
  419. {
  420. "name": "${APPLICATION_NAME}",
  421. "image": "${APPLICATION_NAME}",
  422. "imagePullPolicy": "Always",
  423. "volumeMounts": [
  424. {
  425. "name": "eap-keystore-volume",
  426. "mountPath": "/etc/eap-secret-volume",
  427. "readOnly": true
  428. },
  429. {
  430. "name": "eap-jgroups-keystore-volume",
  431. "mountPath": "/etc/jgroups-encrypt-secret-volume",
  432. "readOnly": true
  433. }
  434. ],
  435. "livenessProbe": {
  436. "exec": {
  437. "command": [
  438. "/bin/bash",
  439. "-c",
  440. "/opt/eap/bin/livenessProbe.sh"
  441. ]
  442. }
  443. },
  444. "readinessProbe": {
  445. "exec": {
  446. "command": [
  447. "/bin/bash",
  448. "-c",
  449. "/opt/eap/bin/readinessProbe.sh"
  450. ]
  451. }
  452. },
  453. "ports": [
  454. {
  455. "name": "jolokia",
  456. "containerPort": 8778,
  457. "protocol": "TCP"
  458. },
  459. {
  460. "name": "http",
  461. "containerPort": 8080,
  462. "protocol": "TCP"
  463. },
  464. {
  465. "name": "https",
  466. "containerPort": 8443,
  467. "protocol": "TCP"
  468. },
  469. {
  470. "name": "ping",
  471. "containerPort": 8888,
  472. "protocol": "TCP"
  473. }
  474. ],
  475. "env": [
  476. {
  477. "name": "MQ_SERVICE_PREFIX_MAPPING",
  478. "value": "${APPLICATION_NAME}-amq=MQ"
  479. },
  480. {
  481. "name": "MQ_JNDI",
  482. "value": "${MQ_JNDI}"
  483. },
  484. {
  485. "name": "MQ_USERNAME",
  486. "value": "${MQ_USERNAME}"
  487. },
  488. {
  489. "name": "MQ_PASSWORD",
  490. "value": "${MQ_PASSWORD}"
  491. },
  492. {
  493. "name": "MQ_PROTOCOL",
  494. "value": "tcp"
  495. },
  496. {
  497. "name": "MQ_QUEUES",
  498. "value": "${MQ_QUEUES}"
  499. },
  500. {
  501. "name": "MQ_TOPICS",
  502. "value": "${MQ_TOPICS}"
  503. },
  504. {
  505. "name": "OPENSHIFT_KUBE_PING_LABELS",
  506. "value": "application=${APPLICATION_NAME}"
  507. },
  508. {
  509. "name": "OPENSHIFT_KUBE_PING_NAMESPACE",
  510. "valueFrom": {
  511. "fieldRef": {
  512. "fieldPath": "metadata.namespace"
  513. }
  514. }
  515. },
  516. {
  517. "name": "HTTPS_KEYSTORE_DIR",
  518. "value": "/etc/eap-secret-volume"
  519. },
  520. {
  521. "name": "HTTPS_KEYSTORE",
  522. "value": "${HTTPS_KEYSTORE}"
  523. },
  524. {
  525. "name": "HTTPS_NAME",
  526. "value": "${HTTPS_NAME}"
  527. },
  528. {
  529. "name": "HTTPS_PASSWORD",
  530. "value": "${HTTPS_PASSWORD}"
  531. },
  532. {
  533. "name": "JGROUPS_ENCRYPT_SECRET",
  534. "value": "${JGROUPS_ENCRYPT_SECRET}"
  535. },
  536. {
  537. "name": "JGROUPS_ENCRYPT_KEYSTORE_DIR",
  538. "value": "/etc/jgroups-encrypt-secret-volume"
  539. },
  540. {
  541. "name": "JGROUPS_ENCRYPT_KEYSTORE",
  542. "value": "${JGROUPS_ENCRYPT_KEYSTORE}"
  543. },
  544. {
  545. "name": "JGROUPS_ENCRYPT_NAME",
  546. "value": "${JGROUPS_ENCRYPT_NAME}"
  547. },
  548. {
  549. "name": "JGROUPS_ENCRYPT_PASSWORD",
  550. "value": "${JGROUPS_ENCRYPT_PASSWORD}"
  551. },
  552. {
  553. "name": "JGROUPS_CLUSTER_PASSWORD",
  554. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  555. }
  556. ]
  557. }
  558. ],
  559. "volumes": [
  560. {
  561. "name": "eap-keystore-volume",
  562. "secret": {
  563. "secretName": "${HTTPS_SECRET}"
  564. }
  565. },
  566. {
  567. "name": "eap-jgroups-keystore-volume",
  568. "secret": {
  569. "secretName": "${JGROUPS_ENCRYPT_SECRET}"
  570. }
  571. }
  572. ]
  573. }
  574. }
  575. }
  576. },
  577. {
  578. "kind": "DeploymentConfig",
  579. "apiVersion": "v1",
  580. "metadata": {
  581. "name": "${APPLICATION_NAME}-amq",
  582. "labels": {
  583. "application": "${APPLICATION_NAME}"
  584. }
  585. },
  586. "spec": {
  587. "strategy": {
  588. "type": "Recreate"
  589. },
  590. "triggers": [
  591. {
  592. "type": "ImageChange",
  593. "imageChangeParams": {
  594. "automatic": true,
  595. "containerNames": [
  596. "${APPLICATION_NAME}-amq"
  597. ],
  598. "from": {
  599. "kind": "ImageStreamTag",
  600. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  601. "name": "jboss-amq-62:1.2"
  602. }
  603. }
  604. },
  605. {
  606. "type": "ConfigChange"
  607. }
  608. ],
  609. "replicas": 1,
  610. "selector": {
  611. "deploymentConfig": "${APPLICATION_NAME}-amq"
  612. },
  613. "template": {
  614. "metadata": {
  615. "name": "${APPLICATION_NAME}-amq",
  616. "labels": {
  617. "deploymentConfig": "${APPLICATION_NAME}-amq",
  618. "application": "${APPLICATION_NAME}"
  619. }
  620. },
  621. "spec": {
  622. "terminationGracePeriodSeconds": 60,
  623. "containers": [
  624. {
  625. "name": "${APPLICATION_NAME}-amq",
  626. "image": "jboss-amq-62",
  627. "imagePullPolicy": "Always",
  628. "readinessProbe": {
  629. "exec": {
  630. "command": [
  631. "/bin/bash",
  632. "-c",
  633. "/opt/amq/bin/readinessProbe.sh"
  634. ]
  635. }
  636. },
  637. "ports": [
  638. {
  639. "name": "amqp",
  640. "containerPort": 5672,
  641. "protocol": "TCP"
  642. },
  643. {
  644. "name": "amqp-ssl",
  645. "containerPort": 5671,
  646. "protocol": "TCP"
  647. },
  648. {
  649. "name": "mqtt",
  650. "containerPort": 1883,
  651. "protocol": "TCP"
  652. },
  653. {
  654. "name": "stomp",
  655. "containerPort": 61613,
  656. "protocol": "TCP"
  657. },
  658. {
  659. "name": "stomp-ssl",
  660. "containerPort": 61612,
  661. "protocol": "TCP"
  662. },
  663. {
  664. "name": "tcp",
  665. "containerPort": 61616,
  666. "protocol": "TCP"
  667. },
  668. {
  669. "name": "tcp-ssl",
  670. "containerPort": 61617,
  671. "protocol": "TCP"
  672. }
  673. ],
  674. "volumeMounts": [
  675. {
  676. "mountPath": "/opt/amq/data/kahadb",
  677. "name": "${APPLICATION_NAME}-amq-pvol"
  678. }
  679. ],
  680. "env": [
  681. {
  682. "name": "AMQ_USER",
  683. "value": "${MQ_USERNAME}"
  684. },
  685. {
  686. "name": "AMQ_PASSWORD",
  687. "value": "${MQ_PASSWORD}"
  688. },
  689. {
  690. "name": "AMQ_TRANSPORTS",
  691. "value": "${MQ_PROTOCOL}"
  692. },
  693. {
  694. "name": "AMQ_QUEUES",
  695. "value": "${MQ_QUEUES}"
  696. },
  697. {
  698. "name": "AMQ_TOPICS",
  699. "value": "${MQ_TOPICS}"
  700. },
  701. {
  702. "name": "AMQ_ADMIN_USERNAME",
  703. "value": "${AMQ_ADMIN_USERNAME}"
  704. },
  705. {
  706. "name": "AMQ_ADMIN_PASSWORD",
  707. "value": "${AMQ_ADMIN_PASSWORD}"
  708. }
  709. ]
  710. }
  711. ],
  712. "volumes": [
  713. {
  714. "name": "${APPLICATION_NAME}-amq-pvol",
  715. "persistentVolumeClaim": {
  716. "claimName": "${APPLICATION_NAME}-amq-claim"
  717. }
  718. }
  719. ]
  720. }
  721. }
  722. }
  723. },
  724. {
  725. "apiVersion": "v1",
  726. "kind": "PersistentVolumeClaim",
  727. "metadata": {
  728. "name": "${APPLICATION_NAME}-amq-claim",
  729. "labels": {
  730. "application": "${APPLICATION_NAME}"
  731. }
  732. },
  733. "spec": {
  734. "accessModes": [
  735. "ReadWriteOnce"
  736. ],
  737. "resources": {
  738. "requests": {
  739. "storage": "${VOLUME_CAPACITY}"
  740. }
  741. }
  742. }
  743. }
  744. ]
  745. }