amq6.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for ActiveMQ brokers."
  7. },
  8. "name": "amq6"
  9. },
  10. "labels": {
  11. "template": "amq6"
  12. },
  13. "parameters": [
  14. {
  15. "description": "ActiveMQ Release version, e.g. 6.2, etc.",
  16. "name": "AMQ_RELEASE",
  17. "value": "6.2"
  18. },
  19. {
  20. "description": "The name for the application.",
  21. "name": "APPLICATION_NAME",
  22. "value": "broker"
  23. },
  24. {
  25. "description": "Protocol to configure. Only openwire is supported by EAP. amqp, amqp+ssl, mqtt, stomp, stomp+ssl, and ssl are not supported by EAP",
  26. "name": "MQ_PROTOCOL",
  27. "value": "openwire"
  28. },
  29. {
  30. "description": "Queue names",
  31. "name": "MQ_QUEUES",
  32. "value": ""
  33. },
  34. {
  35. "description": "Topic names",
  36. "name": "MQ_TOPICS",
  37. "value": ""
  38. },
  39. {
  40. "description": "Broker user name",
  41. "name": "MQ_USERNAME",
  42. "from": "user[a-zA-Z0-9]{3}",
  43. "generate": "expression"
  44. },
  45. {
  46. "description": "Broker user password",
  47. "name": "MQ_PASSWORD",
  48. "from": "[a-zA-Z0-9]{8}",
  49. "generate": "expression"
  50. },
  51. {
  52. "description": "ActiveMQ Admin User",
  53. "name": "AMQ_ADMIN_USERNAME",
  54. "from": "user[a-zA-Z0-9]{3}",
  55. "generate": "expression"
  56. },
  57. {
  58. "description": "ActiveMQ Admin Password",
  59. "name": "AMQ_ADMIN_PASSWORD",
  60. "from": "[a-zA-Z0-9]{8}",
  61. "generate": "expression"
  62. },
  63. {
  64. "description": "Name of a secret containing SSL related files",
  65. "name": "AMQ_SECRET",
  66. "value": "amq-app-secret"
  67. },
  68. {
  69. "description": "SSL trust store filename",
  70. "name": "AMQ_TRUSTSTORE",
  71. "value": "broker.ts"
  72. },
  73. {
  74. "description": "SSL key store filename",
  75. "name": "AMQ_KEYSTORE",
  76. "value": "broker.ks"
  77. }
  78. ],
  79. "objects": [
  80. {
  81. "kind": "Service",
  82. "apiVersion": "v1",
  83. "spec": {
  84. "ports": [
  85. {
  86. "port": 5672,
  87. "targetPort": 5672
  88. }
  89. ],
  90. "selector": {
  91. "deploymentConfig": "${APPLICATION_NAME}-amq"
  92. }
  93. },
  94. "metadata": {
  95. "name": "${APPLICATION_NAME}-amq-amqp",
  96. "labels": {
  97. "application": "${APPLICATION_NAME}"
  98. },
  99. "annotations": {
  100. "description": "The broker's amqp port."
  101. }
  102. }
  103. },
  104. {
  105. "kind": "Service",
  106. "apiVersion": "v1",
  107. "spec": {
  108. "ports": [
  109. {
  110. "port": 5671,
  111. "targetPort": 5671
  112. }
  113. ],
  114. "selector": {
  115. "deploymentConfig": "${APPLICATION_NAME}-amq"
  116. }
  117. },
  118. "metadata": {
  119. "name": "${APPLICATION_NAME}-amq-amqp-ssl",
  120. "labels": {
  121. "application": "${APPLICATION_NAME}"
  122. },
  123. "annotations": {
  124. "description": "The broker's amqp ssl port."
  125. }
  126. }
  127. },
  128. {
  129. "kind": "Service",
  130. "apiVersion": "v1",
  131. "spec": {
  132. "ports": [
  133. {
  134. "port": 1883,
  135. "targetPort": 1883
  136. }
  137. ],
  138. "selector": {
  139. "deploymentConfig": "${APPLICATION_NAME}-amq"
  140. }
  141. },
  142. "metadata": {
  143. "name": "${APPLICATION_NAME}-amq-mqtt",
  144. "labels": {
  145. "application": "${APPLICATION_NAME}"
  146. },
  147. "annotations": {
  148. "description": "The broker's mqtt port."
  149. }
  150. }
  151. },
  152. {
  153. "kind": "Service",
  154. "apiVersion": "v1",
  155. "spec": {
  156. "ports": [
  157. {
  158. "port": 61613,
  159. "targetPort": 61613
  160. }
  161. ],
  162. "selector": {
  163. "deploymentConfig": "${APPLICATION_NAME}-amq"
  164. }
  165. },
  166. "metadata": {
  167. "name": "${APPLICATION_NAME}-amq-stomp",
  168. "labels": {
  169. "application": "${APPLICATION_NAME}"
  170. },
  171. "annotations": {
  172. "description": "The broker's stomp port."
  173. }
  174. }
  175. },
  176. {
  177. "kind": "Service",
  178. "apiVersion": "v1",
  179. "spec": {
  180. "ports": [
  181. {
  182. "port": 61612,
  183. "targetPort": 61612
  184. }
  185. ],
  186. "selector": {
  187. "deploymentConfig": "${APPLICATION_NAME}-amq"
  188. }
  189. },
  190. "metadata": {
  191. "name": "${APPLICATION_NAME}-amq-stomp-ssl",
  192. "labels": {
  193. "application": "${APPLICATION_NAME}"
  194. },
  195. "annotations": {
  196. "description": "The broker's stomp ssl 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 tcp (openwire) port."
  221. }
  222. }
  223. },
  224. {
  225. "kind": "Service",
  226. "apiVersion": "v1",
  227. "spec": {
  228. "ports": [
  229. {
  230. "port": 61617,
  231. "targetPort": 61617
  232. }
  233. ],
  234. "selector": {
  235. "deploymentConfig": "${APPLICATION_NAME}-amq"
  236. }
  237. },
  238. "metadata": {
  239. "name": "${APPLICATION_NAME}-amq-tcp-ssl",
  240. "labels": {
  241. "application": "${APPLICATION_NAME}"
  242. },
  243. "annotations": {
  244. "description": "The broker's tcp ssl (openwire) port."
  245. }
  246. }
  247. },
  248. {
  249. "kind": "DeploymentConfig",
  250. "apiVersion": "v1",
  251. "metadata": {
  252. "name": "${APPLICATION_NAME}-amq",
  253. "labels": {
  254. "application": "${APPLICATION_NAME}"
  255. }
  256. },
  257. "spec": {
  258. "strategy": {
  259. "type": "Recreate"
  260. },
  261. "triggers": [
  262. {
  263. "type": "ImageChange",
  264. "imageChangeParams": {
  265. "automatic": true,
  266. "containerNames": [
  267. "${APPLICATION_NAME}-amq"
  268. ],
  269. "from": {
  270. "kind": "ImageStreamTag",
  271. "namespace": "openshift",
  272. "name": "jboss-amq-6:${AMQ_RELEASE}"
  273. }
  274. }
  275. }
  276. ],
  277. "replicas": 1,
  278. "selector": {
  279. "deploymentConfig": "${APPLICATION_NAME}-amq"
  280. },
  281. "template": {
  282. "metadata": {
  283. "name": "${APPLICATION_NAME}-amq",
  284. "labels": {
  285. "deploymentConfig": "${APPLICATION_NAME}-amq",
  286. "application": "${APPLICATION_NAME}"
  287. }
  288. },
  289. "spec": {
  290. "serviceAccount": "amq-service-account",
  291. "containers": [
  292. {
  293. "name": "${APPLICATION_NAME}-amq",
  294. "image": "jboss-amq-6",
  295. "imagePullPolicy": "Always",
  296. "volumeMounts": [
  297. {
  298. "name": "broker-secret-volume",
  299. "mountPath": "/etc/amq-secret-volume",
  300. "readOnly": true
  301. }
  302. ],
  303. "readinessProbe": {
  304. "exec": {
  305. "command": [
  306. "/bin/bash",
  307. "-c",
  308. "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\"'"
  309. ]
  310. }
  311. },
  312. "ports": [
  313. {
  314. "name": "amqp",
  315. "containerPort": 5672,
  316. "protocol": "TCP"
  317. },
  318. {
  319. "name": "amqp-ssl",
  320. "containerPort": 5671,
  321. "protocol": "TCP"
  322. },
  323. {
  324. "name": "mqtt",
  325. "containerPort": 1883,
  326. "protocol": "TCP"
  327. },
  328. {
  329. "name": "stomp",
  330. "containerPort": 61613,
  331. "protocol": "TCP"
  332. },
  333. {
  334. "name": "stomp-ssl",
  335. "containerPort": 61612,
  336. "protocol": "TCP"
  337. },
  338. {
  339. "name": "tcp",
  340. "containerPort": 61616,
  341. "protocol": "TCP"
  342. },
  343. {
  344. "name": "tcp-ssl",
  345. "containerPort": 61617,
  346. "protocol": "TCP"
  347. }
  348. ],
  349. "env": [
  350. {
  351. "name": "AMQ_USER",
  352. "value": "${MQ_USERNAME}"
  353. },
  354. {
  355. "name": "AMQ_PASSWORD",
  356. "value": "${MQ_PASSWORD}"
  357. },
  358. {
  359. "name": "AMQ_PROTOCOLS",
  360. "value": "${MQ_PROTOCOL}"
  361. },
  362. {
  363. "name": "AMQ_QUEUES",
  364. "value": "${MQ_QUEUES}"
  365. },
  366. {
  367. "name": "AMQ_TOPICS",
  368. "value": "${MQ_TOPICS}"
  369. },
  370. {
  371. "name": "AMQ_ADMIN_USERNAME",
  372. "value": "${AMQ_ADMIN_USERNAME}"
  373. },
  374. {
  375. "name": "AMQ_ADMIN_PASSWORD",
  376. "value": "${AMQ_ADMIN_PASSWORD}"
  377. },
  378. {
  379. "name": "AMQ_MESH_SERVICE_NAME",
  380. "value": "${APPLICATION_NAME}-amq-tcp"
  381. },
  382. {
  383. "name": "AMQ_KEYSTORE_TRUSTSTORE_DIR",
  384. "value": "/etc/amq-secret-volume"
  385. },
  386. {
  387. "name": "AMQ_TRUSTSTORE",
  388. "value": "${AMQ_TRUSTSTORE}"
  389. },
  390. {
  391. "name": "AMQ_KEYSTORE",
  392. "value": "${AMQ_KEYSTORE}"
  393. }
  394. ]
  395. }
  396. ],
  397. "volumes": [
  398. {
  399. "name": "broker-secret-volume",
  400. "secret": {
  401. "secretName": "${AMQ_SECRET}"
  402. }
  403. }
  404. ]
  405. }
  406. }
  407. }
  408. }
  409. ]
  410. }