amq62-ssl.json 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  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 supports SSL and requires usage of OpenShift secrets.",
  7. "iconClass": "icon-jboss",
  8. "tags": "messaging,amq,jboss,xpaas",
  9. "version": "1.1.0"
  10. },
  11. "name": "amq62-ssl"
  12. },
  13. "labels": {
  14. "template": "amq62-ssl",
  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`. SSL variants of these protocols will be configured automaticaly.",
  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": "Name of a secret containing SSL related files",
  72. "name": "AMQ_SECRET",
  73. "value": "amq-app-secret",
  74. "required": true
  75. },
  76. {
  77. "description": "SSL trust store filename",
  78. "name": "AMQ_TRUSTSTORE",
  79. "value": "broker.ts",
  80. "required": true
  81. },
  82. {
  83. "description": "SSL trust store password",
  84. "name": "AMQ_TRUSTSTORE_PASSWORD",
  85. "value": "",
  86. "required": true
  87. },
  88. {
  89. "description": "SSL key store filename",
  90. "name": "AMQ_KEYSTORE",
  91. "value": "broker.ks",
  92. "required": true
  93. },
  94. {
  95. "description": "Password for accessing SSL keystore",
  96. "name": "AMQ_KEYSTORE_PASSWORD",
  97. "value": "",
  98. "required": true
  99. },
  100. {
  101. "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.",
  102. "name": "AMQ_MESH_DISCOVERY_TYPE",
  103. "value": "kube",
  104. "required": false
  105. },
  106. {
  107. "description": "The A-MQ storage usage limit",
  108. "name": "AMQ_STORAGE_USAGE_LIMIT",
  109. "value": "100 gb",
  110. "required": false
  111. },
  112. {
  113. "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.",
  114. "name": "IMAGE_STREAM_NAMESPACE",
  115. "value": "openshift",
  116. "required": true
  117. }
  118. ],
  119. "objects": [
  120. {
  121. "kind": "Service",
  122. "apiVersion": "v1",
  123. "spec": {
  124. "ports": [
  125. {
  126. "port": 5672,
  127. "targetPort": 5672
  128. }
  129. ],
  130. "selector": {
  131. "deploymentConfig": "${APPLICATION_NAME}-amq"
  132. }
  133. },
  134. "metadata": {
  135. "name": "${APPLICATION_NAME}-amq-amqp",
  136. "labels": {
  137. "application": "${APPLICATION_NAME}"
  138. },
  139. "annotations": {
  140. "description": "The broker's AMQP port."
  141. }
  142. }
  143. },
  144. {
  145. "kind": "Service",
  146. "apiVersion": "v1",
  147. "spec": {
  148. "ports": [
  149. {
  150. "port": 5671,
  151. "targetPort": 5671
  152. }
  153. ],
  154. "selector": {
  155. "deploymentConfig": "${APPLICATION_NAME}-amq"
  156. }
  157. },
  158. "metadata": {
  159. "name": "${APPLICATION_NAME}-amq-amqp-ssl",
  160. "labels": {
  161. "application": "${APPLICATION_NAME}"
  162. },
  163. "annotations": {
  164. "description": "The broker's AMQP SSL port."
  165. }
  166. }
  167. },
  168. {
  169. "kind": "Service",
  170. "apiVersion": "v1",
  171. "spec": {
  172. "ports": [
  173. {
  174. "port": 1883,
  175. "targetPort": 1883
  176. }
  177. ],
  178. "selector": {
  179. "deploymentConfig": "${APPLICATION_NAME}-amq"
  180. }
  181. },
  182. "metadata": {
  183. "name": "${APPLICATION_NAME}-amq-mqtt",
  184. "labels": {
  185. "application": "${APPLICATION_NAME}"
  186. },
  187. "annotations": {
  188. "description": "The broker's MQTT port."
  189. }
  190. }
  191. },
  192. {
  193. "kind": "Service",
  194. "apiVersion": "v1",
  195. "spec": {
  196. "ports": [
  197. {
  198. "port": 8883,
  199. "targetPort": 8883
  200. }
  201. ],
  202. "selector": {
  203. "deploymentConfig": "${APPLICATION_NAME}-amq"
  204. }
  205. },
  206. "metadata": {
  207. "name": "${APPLICATION_NAME}-amq-mqtt-ssl",
  208. "labels": {
  209. "application": "${APPLICATION_NAME}"
  210. },
  211. "annotations": {
  212. "description": "The broker's MQTT SSL port."
  213. }
  214. }
  215. },
  216. {
  217. "kind": "Service",
  218. "apiVersion": "v1",
  219. "spec": {
  220. "ports": [
  221. {
  222. "port": 61613,
  223. "targetPort": 61613
  224. }
  225. ],
  226. "selector": {
  227. "deploymentConfig": "${APPLICATION_NAME}-amq"
  228. }
  229. },
  230. "metadata": {
  231. "name": "${APPLICATION_NAME}-amq-stomp",
  232. "labels": {
  233. "application": "${APPLICATION_NAME}"
  234. },
  235. "annotations": {
  236. "description": "The broker's STOMP port."
  237. }
  238. }
  239. },
  240. {
  241. "kind": "Service",
  242. "apiVersion": "v1",
  243. "spec": {
  244. "ports": [
  245. {
  246. "port": 61612,
  247. "targetPort": 61612
  248. }
  249. ],
  250. "selector": {
  251. "deploymentConfig": "${APPLICATION_NAME}-amq"
  252. }
  253. },
  254. "metadata": {
  255. "name": "${APPLICATION_NAME}-amq-stomp-ssl",
  256. "labels": {
  257. "application": "${APPLICATION_NAME}"
  258. },
  259. "annotations": {
  260. "description": "The broker's STOMP SSL port."
  261. }
  262. }
  263. },
  264. {
  265. "kind": "Service",
  266. "apiVersion": "v1",
  267. "spec": {
  268. "ports": [
  269. {
  270. "port": 61616,
  271. "targetPort": 61616
  272. }
  273. ],
  274. "selector": {
  275. "deploymentConfig": "${APPLICATION_NAME}-amq"
  276. }
  277. },
  278. "metadata": {
  279. "name": "${APPLICATION_NAME}-amq-tcp",
  280. "labels": {
  281. "application": "${APPLICATION_NAME}"
  282. },
  283. "annotations": {
  284. "description": "The broker's OpenWire port."
  285. }
  286. }
  287. },
  288. {
  289. "kind": "Service",
  290. "apiVersion": "v1",
  291. "spec": {
  292. "ports": [
  293. {
  294. "port": 61617,
  295. "targetPort": 61617
  296. }
  297. ],
  298. "selector": {
  299. "deploymentConfig": "${APPLICATION_NAME}-amq"
  300. }
  301. },
  302. "metadata": {
  303. "name": "${APPLICATION_NAME}-amq-tcp-ssl",
  304. "labels": {
  305. "application": "${APPLICATION_NAME}"
  306. },
  307. "annotations": {
  308. "description": "The broker's OpenWire (SSL) port."
  309. }
  310. }
  311. },
  312. {
  313. "kind": "DeploymentConfig",
  314. "apiVersion": "v1",
  315. "metadata": {
  316. "name": "${APPLICATION_NAME}-amq",
  317. "labels": {
  318. "application": "${APPLICATION_NAME}"
  319. }
  320. },
  321. "spec": {
  322. "strategy": {
  323. "type": "Recreate"
  324. },
  325. "triggers": [
  326. {
  327. "type": "ImageChange",
  328. "imageChangeParams": {
  329. "automatic": true,
  330. "containerNames": [
  331. "${APPLICATION_NAME}-amq"
  332. ],
  333. "from": {
  334. "kind": "ImageStreamTag",
  335. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  336. "name": "jboss-amq-62:1.1"
  337. }
  338. }
  339. },
  340. {
  341. "type": "ConfigChange"
  342. }
  343. ],
  344. "replicas": 1,
  345. "selector": {
  346. "deploymentConfig": "${APPLICATION_NAME}-amq"
  347. },
  348. "template": {
  349. "metadata": {
  350. "name": "${APPLICATION_NAME}-amq",
  351. "labels": {
  352. "deploymentConfig": "${APPLICATION_NAME}-amq",
  353. "application": "${APPLICATION_NAME}"
  354. }
  355. },
  356. "spec": {
  357. "serviceAccount": "amq-service-account",
  358. "terminationGracePeriodSeconds": 60,
  359. "containers": [
  360. {
  361. "name": "${APPLICATION_NAME}-amq",
  362. "image": "jboss-amq-62",
  363. "imagePullPolicy": "Always",
  364. "volumeMounts": [
  365. {
  366. "name": "broker-secret-volume",
  367. "mountPath": "/etc/amq-secret-volume",
  368. "readOnly": true
  369. }
  370. ],
  371. "readinessProbe": {
  372. "exec": {
  373. "command": [
  374. "/bin/bash",
  375. "-c",
  376. "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\"'"
  377. ]
  378. }
  379. },
  380. "ports": [
  381. {
  382. "name": "amqp",
  383. "containerPort": 5672,
  384. "protocol": "TCP"
  385. },
  386. {
  387. "name": "amqp-ssl",
  388. "containerPort": 5671,
  389. "protocol": "TCP"
  390. },
  391. {
  392. "name": "mqtt",
  393. "containerPort": 1883,
  394. "protocol": "TCP"
  395. },
  396. {
  397. "name": "mqtt-ssl",
  398. "containerPort": 8883,
  399. "protocol": "TCP"
  400. },
  401. {
  402. "name": "stomp",
  403. "containerPort": 61613,
  404. "protocol": "TCP"
  405. },
  406. {
  407. "name": "stomp-ssl",
  408. "containerPort": 61612,
  409. "protocol": "TCP"
  410. },
  411. {
  412. "name": "tcp",
  413. "containerPort": 61616,
  414. "protocol": "TCP"
  415. },
  416. {
  417. "name": "tcp-ssl",
  418. "containerPort": 61617,
  419. "protocol": "TCP"
  420. }
  421. ],
  422. "env": [
  423. {
  424. "name": "AMQ_USER",
  425. "value": "${MQ_USERNAME}"
  426. },
  427. {
  428. "name": "AMQ_PASSWORD",
  429. "value": "${MQ_PASSWORD}"
  430. },
  431. {
  432. "name": "AMQ_TRANSPORTS",
  433. "value": "${MQ_PROTOCOL}"
  434. },
  435. {
  436. "name": "AMQ_QUEUES",
  437. "value": "${MQ_QUEUES}"
  438. },
  439. {
  440. "name": "AMQ_TOPICS",
  441. "value": "${MQ_TOPICS}"
  442. },
  443. {
  444. "name": "AMQ_ADMIN_USERNAME",
  445. "value": "${AMQ_ADMIN_USERNAME}"
  446. },
  447. {
  448. "name": "AMQ_ADMIN_PASSWORD",
  449. "value": "${AMQ_ADMIN_PASSWORD}"
  450. },
  451. {
  452. "name": "AMQ_MESH_DISCOVERY_TYPE",
  453. "value": "${AMQ_MESH_DISCOVERY_TYPE}"
  454. },
  455. {
  456. "name": "AMQ_MESH_SERVICE_NAME",
  457. "value": "${APPLICATION_NAME}-amq-tcp"
  458. },
  459. {
  460. "name": "AMQ_MESH_SERVICE_NAMESPACE",
  461. "valueFrom": {
  462. "fieldRef": {
  463. "fieldPath": "metadata.namespace"
  464. }
  465. }
  466. },
  467. {
  468. "name": "AMQ_KEYSTORE_TRUSTSTORE_DIR",
  469. "value": "/etc/amq-secret-volume"
  470. },
  471. {
  472. "name": "AMQ_TRUSTSTORE",
  473. "value": "${AMQ_TRUSTSTORE}"
  474. },
  475. {
  476. "name": "AMQ_TRUSTSTORE_PASSWORD",
  477. "value": "${AMQ_TRUSTSTORE_PASSWORD}"
  478. },
  479. {
  480. "name": "AMQ_KEYSTORE",
  481. "value": "${AMQ_KEYSTORE}"
  482. },
  483. {
  484. "name": "AMQ_KEYSTORE_PASSWORD",
  485. "value": "${AMQ_KEYSTORE_PASSWORD}"
  486. },
  487. {
  488. "name": "AMQ_STORAGE_USAGE_LIMIT",
  489. "value": "${AMQ_STORAGE_USAGE_LIMIT}"
  490. }
  491. ]
  492. }
  493. ],
  494. "volumes": [
  495. {
  496. "name": "broker-secret-volume",
  497. "secret": {
  498. "secretName": "${AMQ_SECRET}"
  499. }
  500. }
  501. ]
  502. }
  503. }
  504. }
  505. }
  506. ]
  507. }