eap6-amq-persistent-sti.json 24 KB

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