amq62-basic.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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 or in a mesh. 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-basic"
  12. },
  13. "labels": {
  14. "template": "amq62-basic",
  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": "User name for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  44. "name": "MQ_USERNAME",
  45. "from": "user[a-zA-Z0-9]{3}",
  46. "generate": "expression",
  47. "required": false
  48. },
  49. {
  50. "description": "Password for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  51. "name": "MQ_PASSWORD",
  52. "from": "[a-zA-Z0-9]{8}",
  53. "generate": "expression",
  54. "required": false
  55. },
  56. {
  57. "description": "User name for admin user. If left empty, it will be generated.",
  58. "name": "AMQ_ADMIN_USERNAME",
  59. "from": "user[a-zA-Z0-9]{3}",
  60. "generate": "expression",
  61. "required": true
  62. },
  63. {
  64. "description": "Password for admin user. If left empty, it will be generated.",
  65. "name": "AMQ_ADMIN_PASSWORD",
  66. "from": "[a-zA-Z0-9]{8}",
  67. "generate": "expression",
  68. "required": true
  69. },
  70. {
  71. "description": "The discovery agent type to use for discovering mesh endpoints. 'dns' will use OpenShift's DNS service to resolve endpoints. 'kube' will use Kubernetes REST API to resolve service endpoints. If using 'kube' the service account for the pod must have the 'view' role, which can be added via 'oc policy add-role-to-user view system:serviceaccount:<namespace>:default' where <namespace> is the project namespace.",
  72. "name": "AMQ_MESH_DISCOVERY_TYPE",
  73. "value": "kube",
  74. "required": false
  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. "readinessProbe": {
  238. "exec": {
  239. "command": [
  240. "/bin/bash",
  241. "-c",
  242. "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\"'"
  243. ]
  244. }
  245. },
  246. "ports": [
  247. {
  248. "name": "amqp",
  249. "containerPort": 5672,
  250. "protocol": "TCP"
  251. },
  252. {
  253. "name": "mqtt",
  254. "containerPort": 1883,
  255. "protocol": "TCP"
  256. },
  257. {
  258. "name": "stomp",
  259. "containerPort": 61613,
  260. "protocol": "TCP"
  261. },
  262. {
  263. "name": "tcp",
  264. "containerPort": 61616,
  265. "protocol": "TCP"
  266. }
  267. ],
  268. "env": [
  269. {
  270. "name": "AMQ_USER",
  271. "value": "${MQ_USERNAME}"
  272. },
  273. {
  274. "name": "AMQ_PASSWORD",
  275. "value": "${MQ_PASSWORD}"
  276. },
  277. {
  278. "name": "AMQ_TRANSPORTS",
  279. "value": "${MQ_PROTOCOL}"
  280. },
  281. {
  282. "name": "AMQ_QUEUES",
  283. "value": "${MQ_QUEUES}"
  284. },
  285. {
  286. "name": "AMQ_TOPICS",
  287. "value": "${MQ_TOPICS}"
  288. },
  289. {
  290. "name": "AMQ_ADMIN_USERNAME",
  291. "value": "${AMQ_ADMIN_USERNAME}"
  292. },
  293. {
  294. "name": "AMQ_ADMIN_PASSWORD",
  295. "value": "${AMQ_ADMIN_PASSWORD}"
  296. },
  297. {
  298. "name": "AMQ_MESH_DISCOVERY_TYPE",
  299. "value": "${AMQ_MESH_DISCOVERY_TYPE}"
  300. },
  301. {
  302. "name": "AMQ_MESH_SERVICE_NAME",
  303. "value": "${APPLICATION_NAME}-amq-tcp"
  304. },
  305. {
  306. "name": "AMQ_MESH_SERVICE_NAMESPACE",
  307. "valueFrom": {
  308. "fieldRef": {
  309. "fieldPath": "metadata.namespace"
  310. }
  311. }
  312. },
  313. {
  314. "name": "AMQ_STORAGE_USAGE_LIMIT",
  315. "value": "${AMQ_STORAGE_USAGE_LIMIT}"
  316. }
  317. ]
  318. }
  319. ]
  320. }
  321. }
  322. }
  323. }
  324. ]
  325. }