eap64-amq-persistent-s2i.json 26 KB

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