eap6-amq-sti.json 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for EAP 6 A-MQ applications built using STI.",
  7. "iconClass" : "icon-jboss"
  8. },
  9. "name": "eap6-amq-sti"
  10. },
  11. "labels": {
  12. "template": "eap6-amq-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": "JNDI name for connection factory used by applications to connect to the broker, e.g. java:/ConnectionFactory",
  51. "name": "MQ_JNDI",
  52. "value": "java:/ConnectionFactory"
  53. },
  54. {
  55. "description": "Protocol to configure. Only openwire is supported by EAP. amqp, amqp+ssl, mqtt, stomp, stomp+ssl, and ssl are not supported by EAP",
  56. "name": "MQ_PROTOCOL",
  57. "value": "openwire"
  58. },
  59. {
  60. "description": "Queue names",
  61. "name": "MQ_QUEUES",
  62. "value": ""
  63. },
  64. {
  65. "description": "Topic names",
  66. "name": "MQ_TOPICS",
  67. "value": ""
  68. },
  69. {
  70. "description": "The name of the secret containing the keystore file",
  71. "name": "EAP_HTTPS_SECRET",
  72. "value": "eap-app-secret"
  73. },
  74. {
  75. "description": "The name of the keystore file within the secret",
  76. "name": "EAP_HTTPS_KEYSTORE",
  77. "value": "keystore.jks"
  78. },
  79. {
  80. "description": "The name associated with the server certificate",
  81. "name": "EAP_HTTPS_NAME",
  82. "value": ""
  83. },
  84. {
  85. "description": "The password for the keystore and certificate",
  86. "name": "EAP_HTTPS_PASSWORD",
  87. "value": ""
  88. },
  89. {
  90. "description": "Broker user name",
  91. "name": "MQ_USERNAME",
  92. "from": "user[a-zA-Z0-9]{3}",
  93. "generate": "expression"
  94. },
  95. {
  96. "description": "Broker user password",
  97. "name": "MQ_PASSWORD",
  98. "from": "[a-zA-Z0-9]{8}",
  99. "generate": "expression"
  100. },
  101. {
  102. "description": "ActiveMQ Admin User",
  103. "name": "AMQ_ADMIN_USERNAME",
  104. "from": "user[a-zA-Z0-9]{3}",
  105. "generate": "expression"
  106. },
  107. {
  108. "description": "ActiveMQ Admin Password",
  109. "name": "AMQ_ADMIN_PASSWORD",
  110. "from": "[a-zA-Z0-9]{8}",
  111. "generate": "expression"
  112. },
  113. {
  114. "description": "Github trigger secret",
  115. "name": "GITHUB_TRIGGER_SECRET",
  116. "from": "[a-zA-Z0-9]{8}",
  117. "generate": "expression"
  118. },
  119. {
  120. "description": "Generic build trigger secret",
  121. "name": "GENERIC_TRIGGER_SECRET",
  122. "from": "[a-zA-Z0-9]{8}",
  123. "generate": "expression"
  124. }
  125. ],
  126. "objects": [
  127. {
  128. "kind": "Service",
  129. "apiVersion": "v1",
  130. "spec": {
  131. "ports": [
  132. {
  133. "port": 8080,
  134. "targetPort": 8080
  135. }
  136. ],
  137. "selector": {
  138. "deploymentConfig": "${APPLICATION_NAME}"
  139. }
  140. },
  141. "metadata": {
  142. "name": "${APPLICATION_NAME}",
  143. "labels": {
  144. "application": "${APPLICATION_NAME}"
  145. },
  146. "annotations": {
  147. "description": "The web server's http port."
  148. }
  149. }
  150. },
  151. {
  152. "kind": "Service",
  153. "apiVersion": "v1",
  154. "spec": {
  155. "ports": [
  156. {
  157. "port": 8443,
  158. "targetPort": 8443
  159. }
  160. ],
  161. "selector": {
  162. "deploymentConfig": "${APPLICATION_NAME}"
  163. }
  164. },
  165. "metadata": {
  166. "name": "secure-${APPLICATION_NAME}",
  167. "labels": {
  168. "application": "${APPLICATION_NAME}"
  169. },
  170. "annotations": {
  171. "description": "The web server's https port."
  172. }
  173. }
  174. },
  175. {
  176. "kind": "Service",
  177. "apiVersion": "v1",
  178. "spec": {
  179. "ports": [
  180. {
  181. "port": 8888,
  182. "targetPort": 8888
  183. }
  184. ],
  185. "portalIP": "None",
  186. "selector": {
  187. "deploymentConfig": "${APPLICATION_NAME}"
  188. }
  189. },
  190. "metadata": {
  191. "name": "${APPLICATION_NAME}-ping",
  192. "labels": {
  193. "application": "${APPLICATION_NAME}"
  194. },
  195. "annotations": {
  196. "description": "Ping service for clustered applications."
  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 tcp (openwire) port."
  221. }
  222. }
  223. },
  224. {
  225. "kind": "Route",
  226. "apiVersion": "v1",
  227. "id": "${APPLICATION_NAME}-http-route",
  228. "metadata": {
  229. "name": "${APPLICATION_NAME}-http-route",
  230. "labels": {
  231. "application": "${APPLICATION_NAME}"
  232. },
  233. "annotations": {
  234. "description": "Route for application's http service."
  235. }
  236. },
  237. "spec": {
  238. "host": "${APPLICATION_HOSTNAME}",
  239. "to": {
  240. "name": "${APPLICATION_NAME}"
  241. }
  242. }
  243. },
  244. {
  245. "kind": "Route",
  246. "apiVersion": "v1",
  247. "id": "${APPLICATION_NAME}-https-route",
  248. "metadata": {
  249. "name": "${APPLICATION_NAME}-https-route",
  250. "labels": {
  251. "application": "${APPLICATION_NAME}"
  252. },
  253. "annotations": {
  254. "description": "Route for application's https service."
  255. }
  256. },
  257. "spec": {
  258. "host": "${APPLICATION_HOSTNAME}",
  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": "${GIT_URI}",
  291. "ref": "${GIT_REF}"
  292. },
  293. "contextDir":"${GIT_CONTEXT_DIR}"
  294. },
  295. "strategy": {
  296. "type": "Source",
  297. "sourceStrategy": {
  298. "from": {
  299. "kind": "ImageStreamTag",
  300. "namespace": "openshift",
  301. "name": "jboss-eap6-openshift:${EAP_RELEASE}"
  302. }
  303. }
  304. },
  305. "output": {
  306. "to": {
  307. "kind": "ImageStreamTag",
  308. "name": "${APPLICATION_NAME}:latest"
  309. }
  310. },
  311. "triggers": [
  312. {
  313. "type": "GitHub",
  314. "github": {
  315. "secret": "${GITHUB_TRIGGER_SECRET}"
  316. }
  317. },
  318. {
  319. "type": "Generic",
  320. "generic": {
  321. "secret": "${GENERIC_TRIGGER_SECRET}"
  322. }
  323. },
  324. {
  325. "type": "ImageChange",
  326. "imageChange": {}
  327. }
  328. ]
  329. }
  330. },
  331. {
  332. "kind": "DeploymentConfig",
  333. "apiVersion": "v1",
  334. "metadata": {
  335. "name": "${APPLICATION_NAME}",
  336. "labels": {
  337. "application": "${APPLICATION_NAME}"
  338. }
  339. },
  340. "spec": {
  341. "strategy": {
  342. "type": "Recreate"
  343. },
  344. "triggers": [
  345. {
  346. "type": "ImageChange",
  347. "imageChangeParams": {
  348. "automatic": true,
  349. "containerNames": [
  350. "${APPLICATION_NAME}"
  351. ],
  352. "from": {
  353. "kind": "ImageStream",
  354. "name": "${APPLICATION_NAME}"
  355. }
  356. }
  357. }
  358. ],
  359. "replicas": 1,
  360. "selector": {
  361. "deploymentConfig": "${APPLICATION_NAME}"
  362. },
  363. "template": {
  364. "metadata": {
  365. "name": "${APPLICATION_NAME}",
  366. "labels": {
  367. "deploymentConfig": "${APPLICATION_NAME}",
  368. "application": "${APPLICATION_NAME}"
  369. }
  370. },
  371. "spec": {
  372. "serviceAccount": "eap-service-account",
  373. "containers": [
  374. {
  375. "name": "${APPLICATION_NAME}",
  376. "image": "${APPLICATION_NAME}",
  377. "imagePullPolicy": "Always",
  378. "volumeMounts": [
  379. {
  380. "name": "eap-keystore-volume",
  381. "mountPath": "/etc/eap-secret-volume",
  382. "readOnly": true
  383. }
  384. ],
  385. "readinessProbe": {
  386. "exec": {
  387. "command": [
  388. "/bin/bash",
  389. "-c",
  390. "/opt/eap/bin/readinessProbe.sh"
  391. ]
  392. }
  393. },
  394. "ports": [
  395. {
  396. "name": "http",
  397. "containerPort": 8080,
  398. "protocol": "TCP"
  399. },
  400. {
  401. "name": "https",
  402. "containerPort": 8443,
  403. "protocol": "TCP"
  404. },
  405. {
  406. "name": "ping",
  407. "containerPort": 8888,
  408. "protocol": "TCP"
  409. }
  410. ],
  411. "env": [
  412. {
  413. "name": "MQ_SERVICE_PREFIX_MAPPING",
  414. "value": "${APPLICATION_NAME}-amq=MQ"
  415. },
  416. {
  417. "name": "MQ_JNDI",
  418. "value": "${MQ_JNDI}"
  419. },
  420. {
  421. "name": "MQ_USERNAME",
  422. "value": "${MQ_USERNAME}"
  423. },
  424. {
  425. "name": "MQ_PASSWORD",
  426. "value": "${MQ_PASSWORD}"
  427. },
  428. {
  429. "name": "MQ_PROTOCOL",
  430. "value": "tcp"
  431. },
  432. {
  433. "name": "MQ_QUEUES",
  434. "value": "${MQ_QUEUES}"
  435. },
  436. {
  437. "name": "MQ_TOPICS",
  438. "value": "${MQ_TOPICS}"
  439. },
  440. {
  441. "name": "OPENSHIFT_DNS_PING_SERVICE_NAME",
  442. "value": "${APPLICATION_NAME}-ping"
  443. },
  444. {
  445. "name": "OPENSHIFT_DNS_PING_SERVICE_PORT",
  446. "value": "8888"
  447. },
  448. {
  449. "name": "EAP_HTTPS_KEYSTORE_DIR",
  450. "value": "/etc/eap-secret-volume"
  451. },
  452. {
  453. "name": "EAP_HTTPS_KEYSTORE",
  454. "value": "${EAP_HTTPS_KEYSTORE}"
  455. },
  456. {
  457. "name": "EAP_HTTPS_NAME",
  458. "value": "${EAP_HTTPS_NAME}"
  459. },
  460. {
  461. "name": "EAP_HTTPS_PASSWORD",
  462. "value": "${EAP_HTTPS_PASSWORD}"
  463. }
  464. ]
  465. }
  466. ],
  467. "volumes": [
  468. {
  469. "name": "eap-keystore-volume",
  470. "secret": {
  471. "secretName": "${EAP_HTTPS_SECRET}"
  472. }
  473. }
  474. ]
  475. }
  476. }
  477. }
  478. },
  479. {
  480. "kind": "DeploymentConfig",
  481. "apiVersion": "v1",
  482. "metadata": {
  483. "name": "${APPLICATION_NAME}-amq",
  484. "labels": {
  485. "application": "${APPLICATION_NAME}"
  486. }
  487. },
  488. "spec": {
  489. "strategy": {
  490. "type": "Recreate"
  491. },
  492. "triggers": [
  493. {
  494. "type": "ImageChange",
  495. "imageChangeParams": {
  496. "automatic": true,
  497. "containerNames": [
  498. "${APPLICATION_NAME}-amq"
  499. ],
  500. "from": {
  501. "kind": "ImageStreamTag",
  502. "namespace": "openshift",
  503. "name": "jboss-amq-6:${AMQ_RELEASE}"
  504. }
  505. }
  506. }
  507. ],
  508. "replicas": 1,
  509. "selector": {
  510. "deploymentConfig": "${APPLICATION_NAME}-amq"
  511. },
  512. "template": {
  513. "metadata": {
  514. "name": "${APPLICATION_NAME}-amq",
  515. "labels": {
  516. "deploymentConfig": "${APPLICATION_NAME}-amq",
  517. "application": "${APPLICATION_NAME}"
  518. }
  519. },
  520. "spec": {
  521. "containers": [
  522. {
  523. "name": "${APPLICATION_NAME}-amq",
  524. "image": "jboss-amq-6",
  525. "imagePullPolicy": "Always",
  526. "readinessProbe": {
  527. "exec": {
  528. "command": [
  529. "/bin/bash",
  530. "-c",
  531. "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\"'"
  532. ]
  533. }
  534. },
  535. "ports": [
  536. {
  537. "name": "amqp",
  538. "containerPort": 5672,
  539. "protocol": "TCP"
  540. },
  541. {
  542. "name": "amqp-ssl",
  543. "containerPort": 5671,
  544. "protocol": "TCP"
  545. },
  546. {
  547. "name": "mqtt",
  548. "containerPort": 1883,
  549. "protocol": "TCP"
  550. },
  551. {
  552. "name": "stomp",
  553. "containerPort": 61613,
  554. "protocol": "TCP"
  555. },
  556. {
  557. "name": "stomp-ssl",
  558. "containerPort": 61612,
  559. "protocol": "TCP"
  560. },
  561. {
  562. "name": "tcp",
  563. "containerPort": 61616,
  564. "protocol": "TCP"
  565. },
  566. {
  567. "name": "tcp-ssl",
  568. "containerPort": 61617,
  569. "protocol": "TCP"
  570. }
  571. ],
  572. "env": [
  573. {
  574. "name": "AMQ_USER",
  575. "value": "${MQ_USERNAME}"
  576. },
  577. {
  578. "name": "AMQ_PASSWORD",
  579. "value": "${MQ_PASSWORD}"
  580. },
  581. {
  582. "name": "AMQ_PROTOCOLS",
  583. "value": "${MQ_PROTOCOL}"
  584. },
  585. {
  586. "name": "AMQ_QUEUES",
  587. "value": "${MQ_QUEUES}"
  588. },
  589. {
  590. "name": "AMQ_TOPICS",
  591. "value": "${MQ_TOPICS}"
  592. },
  593. {
  594. "name": "AMQ_ADMIN_USERNAME",
  595. "value": "${AMQ_ADMIN_USERNAME}"
  596. },
  597. {
  598. "name": "AMQ_ADMIN_PASSWORD",
  599. "value": "${AMQ_ADMIN_PASSWORD}"
  600. }
  601. ]
  602. }
  603. ]
  604. }
  605. }
  606. }
  607. }
  608. ]
  609. }