amq6-persistent.json 16 KB

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