amq62-persistent-ssl.json 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for JBoss A-MQ brokers. These are deployed as standalone and use persistent storage for saving messages. This template supports SSL and requires usage of OpenShift secrets.",
  7. "iconClass": "icon-jboss",
  8. "tags": "messaging,amq,jboss,xpaas",
  9. "version": "1.3.1"
  10. },
  11. "name": "amq62-persistent-ssl"
  12. },
  13. "labels": {
  14. "template": "amq62-persistent-ssl",
  15. "xpaas": "1.3.1"
  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": "Split the data directory for each node in a mesh.",
  26. "name": "AMQ_SPLIT",
  27. "value": "false",
  28. "required": false
  29. },
  30. {
  31. "description": "Protocols to configure, separated by commas. Allowed values are: `openwire`, `amqp`, `stomp` and `mqtt`.",
  32. "name": "MQ_PROTOCOL",
  33. "value": "openwire",
  34. "required": false
  35. },
  36. {
  37. "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.",
  38. "name": "MQ_QUEUES",
  39. "value": "",
  40. "required": false
  41. },
  42. {
  43. "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.",
  44. "name": "MQ_TOPICS",
  45. "value": "",
  46. "required": false
  47. },
  48. {
  49. "description": "Size of persistent storage for database volume.",
  50. "name": "VOLUME_CAPACITY",
  51. "value": "512Mi",
  52. "required": true
  53. },
  54. {
  55. "description": "User name for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  56. "name": "MQ_USERNAME",
  57. "from": "user[a-zA-Z0-9]{3}",
  58. "generate": "expression",
  59. "required": false
  60. },
  61. {
  62. "description": "Password for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  63. "name": "MQ_PASSWORD",
  64. "from": "[a-zA-Z0-9]{8}",
  65. "generate": "expression",
  66. "required": false
  67. },
  68. {
  69. "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.",
  70. "name": "AMQ_MESH_DISCOVERY_TYPE",
  71. "value": "kube",
  72. "required": false
  73. },
  74. {
  75. "description": "Name of a secret containing SSL related files",
  76. "name": "AMQ_SECRET",
  77. "value": "amq-app-secret",
  78. "required": true
  79. },
  80. {
  81. "description": "SSL trust store filename",
  82. "name": "AMQ_TRUSTSTORE",
  83. "value": "broker.ts",
  84. "required": true
  85. },
  86. {
  87. "description": "SSL trust store password",
  88. "name": "AMQ_TRUSTSTORE_PASSWORD",
  89. "value": "",
  90. "required": true
  91. },
  92. {
  93. "description": "SSL key store filename",
  94. "name": "AMQ_KEYSTORE",
  95. "value": "broker.ks",
  96. "required": true
  97. },
  98. {
  99. "description": "Password for accessing SSL keystore",
  100. "name": "AMQ_KEYSTORE_PASSWORD",
  101. "value": "",
  102. "required": true
  103. },
  104. {
  105. "description": "The A-MQ storage usage limit",
  106. "name": "AMQ_STORAGE_USAGE_LIMIT",
  107. "value": "100 gb",
  108. "required": false
  109. },
  110. {
  111. "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.",
  112. "name": "IMAGE_STREAM_NAMESPACE",
  113. "value": "openshift",
  114. "required": true
  115. }
  116. ],
  117. "objects": [
  118. {
  119. "kind": "Service",
  120. "apiVersion": "v1",
  121. "spec": {
  122. "ports": [
  123. {
  124. "port": 5672,
  125. "targetPort": 5672
  126. }
  127. ],
  128. "selector": {
  129. "deploymentConfig": "${APPLICATION_NAME}-amq"
  130. }
  131. },
  132. "metadata": {
  133. "name": "${APPLICATION_NAME}-amq-amqp",
  134. "labels": {
  135. "application": "${APPLICATION_NAME}"
  136. },
  137. "annotations": {
  138. "description": "The broker's AMQP port."
  139. }
  140. }
  141. },
  142. {
  143. "kind": "Service",
  144. "apiVersion": "v1",
  145. "spec": {
  146. "ports": [
  147. {
  148. "port": 5671,
  149. "targetPort": 5671
  150. }
  151. ],
  152. "selector": {
  153. "deploymentConfig": "${APPLICATION_NAME}-amq"
  154. }
  155. },
  156. "metadata": {
  157. "name": "${APPLICATION_NAME}-amq-amqp-ssl",
  158. "labels": {
  159. "application": "${APPLICATION_NAME}"
  160. },
  161. "annotations": {
  162. "description": "The broker's AMQP SSL port."
  163. }
  164. }
  165. },
  166. {
  167. "kind": "Service",
  168. "apiVersion": "v1",
  169. "spec": {
  170. "ports": [
  171. {
  172. "port": 1883,
  173. "targetPort": 1883
  174. }
  175. ],
  176. "selector": {
  177. "deploymentConfig": "${APPLICATION_NAME}-amq"
  178. }
  179. },
  180. "metadata": {
  181. "name": "${APPLICATION_NAME}-amq-mqtt",
  182. "labels": {
  183. "application": "${APPLICATION_NAME}"
  184. },
  185. "annotations": {
  186. "description": "The broker's MQTT port."
  187. }
  188. }
  189. },
  190. {
  191. "kind": "Service",
  192. "apiVersion": "v1",
  193. "spec": {
  194. "ports": [
  195. {
  196. "port": 8883,
  197. "targetPort": 8883
  198. }
  199. ],
  200. "selector": {
  201. "deploymentConfig": "${APPLICATION_NAME}-amq"
  202. }
  203. },
  204. "metadata": {
  205. "name": "${APPLICATION_NAME}-amq-mqtt-ssl",
  206. "labels": {
  207. "application": "${APPLICATION_NAME}"
  208. },
  209. "annotations": {
  210. "description": "The broker's MQTT SSL port."
  211. }
  212. }
  213. },
  214. {
  215. "kind": "Service",
  216. "apiVersion": "v1",
  217. "spec": {
  218. "ports": [
  219. {
  220. "port": 61613,
  221. "targetPort": 61613
  222. }
  223. ],
  224. "selector": {
  225. "deploymentConfig": "${APPLICATION_NAME}-amq"
  226. }
  227. },
  228. "metadata": {
  229. "name": "${APPLICATION_NAME}-amq-stomp",
  230. "labels": {
  231. "application": "${APPLICATION_NAME}"
  232. },
  233. "annotations": {
  234. "description": "The broker's STOMP port."
  235. }
  236. }
  237. },
  238. {
  239. "kind": "Service",
  240. "apiVersion": "v1",
  241. "spec": {
  242. "ports": [
  243. {
  244. "port": 61612,
  245. "targetPort": 61612
  246. }
  247. ],
  248. "selector": {
  249. "deploymentConfig": "${APPLICATION_NAME}-amq"
  250. }
  251. },
  252. "metadata": {
  253. "name": "${APPLICATION_NAME}-amq-stomp-ssl",
  254. "labels": {
  255. "application": "${APPLICATION_NAME}"
  256. },
  257. "annotations": {
  258. "description": "The broker's STOMP SSL port."
  259. }
  260. }
  261. },
  262. {
  263. "kind": "Service",
  264. "apiVersion": "v1",
  265. "spec": {
  266. "ports": [
  267. {
  268. "port": 61616,
  269. "targetPort": 61616
  270. }
  271. ],
  272. "selector": {
  273. "deploymentConfig": "${APPLICATION_NAME}-amq"
  274. }
  275. },
  276. "metadata": {
  277. "name": "${APPLICATION_NAME}-amq-tcp",
  278. "labels": {
  279. "application": "${APPLICATION_NAME}"
  280. },
  281. "annotations": {
  282. "description": "The broker's OpenWire port."
  283. }
  284. }
  285. },
  286. {
  287. "kind": "Service",
  288. "apiVersion": "v1",
  289. "spec": {
  290. "ports": [
  291. {
  292. "port": 61617,
  293. "targetPort": 61617
  294. }
  295. ],
  296. "selector": {
  297. "deploymentConfig": "${APPLICATION_NAME}-amq"
  298. }
  299. },
  300. "metadata": {
  301. "name": "${APPLICATION_NAME}-amq-tcp-ssl",
  302. "labels": {
  303. "application": "${APPLICATION_NAME}"
  304. },
  305. "annotations": {
  306. "description": "The broker's OpenWire (SSL) port."
  307. }
  308. }
  309. },
  310. {
  311. "kind": "DeploymentConfig",
  312. "apiVersion": "v1",
  313. "metadata": {
  314. "name": "${APPLICATION_NAME}-amq",
  315. "labels": {
  316. "application": "${APPLICATION_NAME}"
  317. }
  318. },
  319. "spec": {
  320. "strategy": {
  321. "type": "Rolling",
  322. "rollingParams": {
  323. "maxSurge": 0
  324. }
  325. },
  326. "triggers": [
  327. {
  328. "type": "ImageChange",
  329. "imageChangeParams": {
  330. "automatic": true,
  331. "containerNames": [
  332. "${APPLICATION_NAME}-amq"
  333. ],
  334. "from": {
  335. "kind": "ImageStreamTag",
  336. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  337. "name": "jboss-amq-62:1.3"
  338. }
  339. }
  340. },
  341. {
  342. "type": "ConfigChange"
  343. }
  344. ],
  345. "replicas": 1,
  346. "selector": {
  347. "deploymentConfig": "${APPLICATION_NAME}-amq"
  348. },
  349. "template": {
  350. "metadata": {
  351. "name": "${APPLICATION_NAME}-amq",
  352. "labels": {
  353. "deploymentConfig": "${APPLICATION_NAME}-amq",
  354. "application": "${APPLICATION_NAME}"
  355. }
  356. },
  357. "spec": {
  358. "serviceAccountName": "amq-service-account",
  359. "terminationGracePeriodSeconds": 60,
  360. "containers": [
  361. {
  362. "name": "${APPLICATION_NAME}-amq",
  363. "image": "jboss-amq-62",
  364. "imagePullPolicy": "Always",
  365. "volumeMounts": [
  366. {
  367. "name": "broker-secret-volume",
  368. "mountPath": "/etc/amq-secret-volume",
  369. "readOnly": true
  370. },
  371. {
  372. "mountPath": "/opt/amq/data",
  373. "name": "${APPLICATION_NAME}-amq-pvol"
  374. }
  375. ],
  376. "readinessProbe": {
  377. "exec": {
  378. "command": [
  379. "/bin/bash",
  380. "-c",
  381. "/opt/amq/bin/readinessProbe.sh"
  382. ]
  383. }
  384. },
  385. "ports": [
  386. {
  387. "name": "jolokia",
  388. "containerPort": 8778,
  389. "protocol": "TCP"
  390. },
  391. {
  392. "name": "amqp",
  393. "containerPort": 5672,
  394. "protocol": "TCP"
  395. },
  396. {
  397. "name": "amqp-ssl",
  398. "containerPort": 5671,
  399. "protocol": "TCP"
  400. },
  401. {
  402. "name": "mqtt",
  403. "containerPort": 1883,
  404. "protocol": "TCP"
  405. },
  406. {
  407. "name": "mqtt-ssl",
  408. "containerPort": 8883,
  409. "protocol": "TCP"
  410. },
  411. {
  412. "name": "stomp",
  413. "containerPort": 61613,
  414. "protocol": "TCP"
  415. },
  416. {
  417. "name": "stomp-ssl",
  418. "containerPort": 61612,
  419. "protocol": "TCP"
  420. },
  421. {
  422. "name": "tcp",
  423. "containerPort": 61616,
  424. "protocol": "TCP"
  425. },
  426. {
  427. "name": "tcp-ssl",
  428. "containerPort": 61617,
  429. "protocol": "TCP"
  430. }
  431. ],
  432. "env": [
  433. {
  434. "name": "AMQ_USER",
  435. "value": "${MQ_USERNAME}"
  436. },
  437. {
  438. "name": "AMQ_PASSWORD",
  439. "value": "${MQ_PASSWORD}"
  440. },
  441. {
  442. "name": "AMQ_TRANSPORTS",
  443. "value": "${MQ_PROTOCOL}"
  444. },
  445. {
  446. "name": "AMQ_QUEUES",
  447. "value": "${MQ_QUEUES}"
  448. },
  449. {
  450. "name": "AMQ_TOPICS",
  451. "value": "${MQ_TOPICS}"
  452. },
  453. {
  454. "name": "AMQ_SPLIT",
  455. "value": "${AMQ_SPLIT}"
  456. },
  457. {
  458. "name": "AMQ_MESH_DISCOVERY_TYPE",
  459. "value": "${AMQ_MESH_DISCOVERY_TYPE}"
  460. },
  461. {
  462. "name": "AMQ_MESH_SERVICE_NAME",
  463. "value": "${APPLICATION_NAME}-amq-tcp"
  464. },
  465. {
  466. "name": "AMQ_MESH_SERVICE_NAMESPACE",
  467. "valueFrom": {
  468. "fieldRef": {
  469. "fieldPath": "metadata.namespace"
  470. }
  471. }
  472. },
  473. {
  474. "name": "AMQ_KEYSTORE_TRUSTSTORE_DIR",
  475. "value": "/etc/amq-secret-volume"
  476. },
  477. {
  478. "name": "AMQ_TRUSTSTORE",
  479. "value": "${AMQ_TRUSTSTORE}"
  480. },
  481. {
  482. "name": "AMQ_TRUSTSTORE_PASSWORD",
  483. "value": "${AMQ_TRUSTSTORE_PASSWORD}"
  484. },
  485. {
  486. "name": "AMQ_KEYSTORE",
  487. "value": "${AMQ_KEYSTORE}"
  488. },
  489. {
  490. "name": "AMQ_KEYSTORE_PASSWORD",
  491. "value": "${AMQ_KEYSTORE_PASSWORD}"
  492. },
  493. {
  494. "name": "AMQ_STORAGE_USAGE_LIMIT",
  495. "value": "${AMQ_STORAGE_USAGE_LIMIT}"
  496. }
  497. ]
  498. }
  499. ],
  500. "volumes": [
  501. {
  502. "name": "broker-secret-volume",
  503. "secret": {
  504. "secretName": "${AMQ_SECRET}"
  505. }
  506. },
  507. {
  508. "name": "${APPLICATION_NAME}-amq-pvol",
  509. "persistentVolumeClaim": {
  510. "claimName": "${APPLICATION_NAME}-amq-claim"
  511. }
  512. }
  513. ]
  514. }
  515. }
  516. }
  517. },
  518. {
  519. "apiVersion": "v1",
  520. "kind": "PersistentVolumeClaim",
  521. "metadata": {
  522. "name": "${APPLICATION_NAME}-amq-claim",
  523. "labels": {
  524. "application": "${APPLICATION_NAME}"
  525. }
  526. },
  527. "spec": {
  528. "accessModes": [
  529. "ReadWriteMany"
  530. ],
  531. "resources": {
  532. "requests": {
  533. "storage": "${VOLUME_CAPACITY}"
  534. }
  535. }
  536. }
  537. }
  538. ]
  539. }