amq62-persistent.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for JBoss A-MQ brokers. These can be deployed as standalone and use persistent storage for saving messages. This template doesn't feature SSL support.",
  7. "iconClass": "icon-jboss",
  8. "tags": "messaging,amq,jboss,xpaas",
  9. "version": "1.1.0"
  10. },
  11. "name": "amq62-persistent"
  12. },
  13. "labels": {
  14. "template": "amq62-persistent",
  15. "xpaas": "1.1.0"
  16. },
  17. "parameters": [
  18. {
  19. "description": "The name for the application.",
  20. "name": "APPLICATION_NAME",
  21. "value": "broker",
  22. "required": true
  23. },
  24. {
  25. "description": "Protocols to configure, separated by commas. Allowed values are: `openwire`, `amqp`, `stomp` and `mqtt`.",
  26. "name": "MQ_PROTOCOL",
  27. "value": "openwire",
  28. "required": false
  29. },
  30. {
  31. "description": "Queue names, separated by commas. These queues will be automatically created when the broker starts. If left empty, queues will be still created dynamically.",
  32. "name": "MQ_QUEUES",
  33. "value": "",
  34. "required": false
  35. },
  36. {
  37. "description": "Topic names, separated by commas. These topics will be automatically created when the broker starts. If left empty, topics will be still created dynamically.",
  38. "name": "MQ_TOPICS",
  39. "value": "",
  40. "required": false
  41. },
  42. {
  43. "description": "Size of persistent storage for database volume.",
  44. "name": "VOLUME_CAPACITY",
  45. "value": "512Mi",
  46. "required": true
  47. },
  48. {
  49. "description": "User name for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  50. "name": "MQ_USERNAME",
  51. "from": "user[a-zA-Z0-9]{3}",
  52. "generate": "expression",
  53. "required": false
  54. },
  55. {
  56. "description": "Password for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  57. "name": "MQ_PASSWORD",
  58. "from": "[a-zA-Z0-9]{8}",
  59. "generate": "expression",
  60. "required": false
  61. },
  62. {
  63. "description": "User name for admin user. If left empty, it will be generated.",
  64. "name": "AMQ_ADMIN_USERNAME",
  65. "from": "user[a-zA-Z0-9]{3}",
  66. "generate": "expression",
  67. "required": true
  68. },
  69. {
  70. "description": "Password for admin user. If left empty, it will be generated.",
  71. "name": "AMQ_ADMIN_PASSWORD",
  72. "from": "[a-zA-Z0-9]{8}",
  73. "generate": "expression",
  74. "required": true
  75. },
  76. {
  77. "description": "The A-MQ storage usage limit",
  78. "name": "AMQ_STORAGE_USAGE_LIMIT",
  79. "value": "100 gb",
  80. "required": false
  81. },
  82. {
  83. "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.",
  84. "name": "IMAGE_STREAM_NAMESPACE",
  85. "value": "openshift",
  86. "required": true
  87. }
  88. ],
  89. "objects": [
  90. {
  91. "kind": "Service",
  92. "apiVersion": "v1",
  93. "spec": {
  94. "ports": [
  95. {
  96. "port": 5672,
  97. "targetPort": 5672
  98. }
  99. ],
  100. "selector": {
  101. "deploymentConfig": "${APPLICATION_NAME}-amq"
  102. }
  103. },
  104. "metadata": {
  105. "name": "${APPLICATION_NAME}-amq-amqp",
  106. "labels": {
  107. "application": "${APPLICATION_NAME}"
  108. },
  109. "annotations": {
  110. "description": "The broker's AMQP port."
  111. }
  112. }
  113. },
  114. {
  115. "kind": "Service",
  116. "apiVersion": "v1",
  117. "spec": {
  118. "ports": [
  119. {
  120. "port": 1883,
  121. "targetPort": 1883
  122. }
  123. ],
  124. "selector": {
  125. "deploymentConfig": "${APPLICATION_NAME}-amq"
  126. }
  127. },
  128. "metadata": {
  129. "name": "${APPLICATION_NAME}-amq-mqtt",
  130. "labels": {
  131. "application": "${APPLICATION_NAME}"
  132. },
  133. "annotations": {
  134. "description": "The broker's MQTT port."
  135. }
  136. }
  137. },
  138. {
  139. "kind": "Service",
  140. "apiVersion": "v1",
  141. "spec": {
  142. "ports": [
  143. {
  144. "port": 61613,
  145. "targetPort": 61613
  146. }
  147. ],
  148. "selector": {
  149. "deploymentConfig": "${APPLICATION_NAME}-amq"
  150. }
  151. },
  152. "metadata": {
  153. "name": "${APPLICATION_NAME}-amq-stomp",
  154. "labels": {
  155. "application": "${APPLICATION_NAME}"
  156. },
  157. "annotations": {
  158. "description": "The broker's STOMP port."
  159. }
  160. }
  161. },
  162. {
  163. "kind": "Service",
  164. "apiVersion": "v1",
  165. "spec": {
  166. "ports": [
  167. {
  168. "port": 61616,
  169. "targetPort": 61616
  170. }
  171. ],
  172. "selector": {
  173. "deploymentConfig": "${APPLICATION_NAME}-amq"
  174. }
  175. },
  176. "metadata": {
  177. "name": "${APPLICATION_NAME}-amq-tcp",
  178. "labels": {
  179. "application": "${APPLICATION_NAME}"
  180. },
  181. "annotations": {
  182. "description": "The broker's OpenWire port."
  183. }
  184. }
  185. },
  186. {
  187. "kind": "DeploymentConfig",
  188. "apiVersion": "v1",
  189. "metadata": {
  190. "name": "${APPLICATION_NAME}-amq",
  191. "labels": {
  192. "application": "${APPLICATION_NAME}"
  193. }
  194. },
  195. "spec": {
  196. "strategy": {
  197. "type": "Recreate"
  198. },
  199. "triggers": [
  200. {
  201. "type": "ImageChange",
  202. "imageChangeParams": {
  203. "automatic": true,
  204. "containerNames": [
  205. "${APPLICATION_NAME}-amq"
  206. ],
  207. "from": {
  208. "kind": "ImageStreamTag",
  209. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  210. "name": "jboss-amq-62:1.1"
  211. }
  212. }
  213. },
  214. {
  215. "type": "ConfigChange"
  216. }
  217. ],
  218. "replicas": 1,
  219. "selector": {
  220. "deploymentConfig": "${APPLICATION_NAME}-amq"
  221. },
  222. "template": {
  223. "metadata": {
  224. "name": "${APPLICATION_NAME}-amq",
  225. "labels": {
  226. "deploymentConfig": "${APPLICATION_NAME}-amq",
  227. "application": "${APPLICATION_NAME}"
  228. }
  229. },
  230. "spec": {
  231. "terminationGracePeriodSeconds": 60,
  232. "containers": [
  233. {
  234. "name": "${APPLICATION_NAME}-amq",
  235. "image": "jboss-amq-62",
  236. "imagePullPolicy": "Always",
  237. "volumeMounts": [
  238. {
  239. "mountPath": "/opt/amq/data/kahadb",
  240. "name": "${APPLICATION_NAME}-amq-pvol"
  241. }
  242. ],
  243. "readinessProbe": {
  244. "exec": {
  245. "command": [
  246. "/bin/bash",
  247. "-c",
  248. "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\"'"
  249. ]
  250. }
  251. },
  252. "ports": [
  253. {
  254. "name": "amqp",
  255. "containerPort": 5672,
  256. "protocol": "TCP"
  257. },
  258. {
  259. "name": "mqtt",
  260. "containerPort": 1883,
  261. "protocol": "TCP"
  262. },
  263. {
  264. "name": "stomp",
  265. "containerPort": 61613,
  266. "protocol": "TCP"
  267. },
  268. {
  269. "name": "tcp",
  270. "containerPort": 61616,
  271. "protocol": "TCP"
  272. }
  273. ],
  274. "env": [
  275. {
  276. "name": "AMQ_USER",
  277. "value": "${MQ_USERNAME}"
  278. },
  279. {
  280. "name": "AMQ_PASSWORD",
  281. "value": "${MQ_PASSWORD}"
  282. },
  283. {
  284. "name": "AMQ_TRANSPORTS",
  285. "value": "${MQ_PROTOCOL}"
  286. },
  287. {
  288. "name": "AMQ_QUEUES",
  289. "value": "${MQ_QUEUES}"
  290. },
  291. {
  292. "name": "AMQ_TOPICS",
  293. "value": "${MQ_TOPICS}"
  294. },
  295. {
  296. "name": "AMQ_ADMIN_USERNAME",
  297. "value": "${AMQ_ADMIN_USERNAME}"
  298. },
  299. {
  300. "name": "AMQ_ADMIN_PASSWORD",
  301. "value": "${AMQ_ADMIN_PASSWORD}"
  302. },
  303. {
  304. "name": "AMQ_STORAGE_USAGE_LIMIT",
  305. "value": "${AMQ_STORAGE_USAGE_LIMIT}"
  306. }
  307. ]
  308. }
  309. ],
  310. "volumes": [
  311. {
  312. "name": "${APPLICATION_NAME}-amq-pvol",
  313. "persistentVolumeClaim": {
  314. "claimName": "${APPLICATION_NAME}-amq-claim"
  315. }
  316. }
  317. ]
  318. }
  319. }
  320. }
  321. },
  322. {
  323. "apiVersion": "v1",
  324. "kind": "PersistentVolumeClaim",
  325. "metadata": {
  326. "name": "${APPLICATION_NAME}-amq-claim",
  327. "labels": {
  328. "application": "${APPLICATION_NAME}"
  329. }
  330. },
  331. "spec": {
  332. "accessModes": [
  333. "ReadWriteOnce"
  334. ],
  335. "resources": {
  336. "requests": {
  337. "storage": "${VOLUME_CAPACITY}"
  338. }
  339. }
  340. }
  341. }
  342. ]
  343. }