eap64-amq-s2i.json 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Application template for EAP 6 A-MQ applications built using S2I.",
  7. "iconClass": "icon-jboss",
  8. "tags": "eap,amq,javaee,java,messaging,jboss,xpaas",
  9. "version": "1.1.0"
  10. },
  11. "name": "eap64-amq-s2i"
  12. },
  13. "labels": {
  14. "template": "eap64-amq-s2i",
  15. "xpaas": "1.1.0"
  16. },
  17. "parameters": [
  18. {
  19. "description": "The name for the application.",
  20. "name": "APPLICATION_NAME",
  21. "value": "eap-app",
  22. "required": true
  23. },
  24. {
  25. "description": "Custom hostname for service routes. Leave blank for default hostname, e.g.: <application-name>.<project>.<default-domain-suffix>",
  26. "name": "APPLICATION_DOMAIN",
  27. "value": "",
  28. "required": false
  29. },
  30. {
  31. "description": "Git source URI for application",
  32. "name": "SOURCE_REPOSITORY_URL",
  33. "value": "https://github.com/jboss-openshift/openshift-quickstarts.git",
  34. "required": true
  35. },
  36. {
  37. "description": "Git branch/tag reference",
  38. "name": "SOURCE_REPOSITORY_REF",
  39. "value": "1.1",
  40. "required": false
  41. },
  42. {
  43. "description": "Path within Git project to build; empty for root project directory.",
  44. "name": "CONTEXT_DIR",
  45. "value": "helloworld-mdb",
  46. "required": false
  47. },
  48. {
  49. "description": "JNDI name for connection factory used by applications to connect to the broker, e.g. java:/ConnectionFactory",
  50. "name": "MQ_JNDI",
  51. "value": "java:/ConnectionFactory",
  52. "required": false
  53. },
  54. {
  55. "description": "Broker protocols to configure, separated by commas. Allowed values are: `openwire`, `amqp`, `stomp` and `mqtt`. Only `openwire` is supported by EAP.",
  56. "name": "MQ_PROTOCOL",
  57. "value": "openwire",
  58. "required": false
  59. },
  60. {
  61. "description": "Queue names, separated by commas. These queues will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP.",
  62. "name": "MQ_QUEUES",
  63. "value": "HELLOWORLDMDBQueue",
  64. "required": false
  65. },
  66. {
  67. "description": "Topic names, separated by commas. These topics will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP.",
  68. "name": "MQ_TOPICS",
  69. "value": "HELLOWORLDMDBTopic",
  70. "required": false
  71. },
  72. {
  73. "description": "The name of the secret containing the keystore file",
  74. "name": "EAP_HTTPS_SECRET",
  75. "value": "eap-app-secret",
  76. "required": false
  77. },
  78. {
  79. "description": "The name of the keystore file within the secret",
  80. "name": "EAP_HTTPS_KEYSTORE",
  81. "value": "keystore.jks",
  82. "required": false
  83. },
  84. {
  85. "description": "The name associated with the server certificate",
  86. "name": "EAP_HTTPS_NAME",
  87. "value": "",
  88. "required": false
  89. },
  90. {
  91. "description": "The password for the keystore and certificate",
  92. "name": "EAP_HTTPS_PASSWORD",
  93. "value": "",
  94. "required": false
  95. },
  96. {
  97. "description": "User name for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  98. "name": "MQ_USERNAME",
  99. "from": "user[a-zA-Z0-9]{3}",
  100. "generate": "expression",
  101. "required": false
  102. },
  103. {
  104. "description": "Password for standard broker user. It is required for connecting to the broker. If left empty, it will be generated.",
  105. "name": "MQ_PASSWORD",
  106. "from": "[a-zA-Z0-9]{8}",
  107. "generate": "expression",
  108. "required": false
  109. },
  110. {
  111. "description": "User name for broker admin. If left empty, it will be generated.",
  112. "name": "AMQ_ADMIN_USERNAME",
  113. "from": "user[a-zA-Z0-9]{3}",
  114. "generate": "expression",
  115. "required": true
  116. },
  117. {
  118. "description": "Password for broker admin. If left empty, it will be generated.",
  119. "name": "AMQ_ADMIN_PASSWORD",
  120. "from": "[a-zA-Z0-9]{8}",
  121. "generate": "expression",
  122. "required": true
  123. },
  124. {
  125. "description": "GitHub trigger secret",
  126. "name": "GITHUB_WEBHOOK_SECRET",
  127. "from": "[a-zA-Z0-9]{8}",
  128. "generate": "expression",
  129. "required": true
  130. },
  131. {
  132. "description": "Generic build trigger secret",
  133. "name": "GENERIC_WEBHOOK_SECRET",
  134. "from": "[a-zA-Z0-9]{8}",
  135. "generate": "expression",
  136. "required": true
  137. },
  138. {
  139. "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.",
  140. "name": "IMAGE_STREAM_NAMESPACE",
  141. "value": "openshift",
  142. "required": true
  143. }
  144. ],
  145. "objects": [
  146. {
  147. "kind": "Service",
  148. "apiVersion": "v1",
  149. "spec": {
  150. "ports": [
  151. {
  152. "port": 8080,
  153. "targetPort": 8080
  154. }
  155. ],
  156. "selector": {
  157. "deploymentConfig": "${APPLICATION_NAME}"
  158. }
  159. },
  160. "metadata": {
  161. "name": "${APPLICATION_NAME}",
  162. "labels": {
  163. "application": "${APPLICATION_NAME}"
  164. },
  165. "annotations": {
  166. "description": "The web server's HTTP port."
  167. }
  168. }
  169. },
  170. {
  171. "kind": "Service",
  172. "apiVersion": "v1",
  173. "spec": {
  174. "ports": [
  175. {
  176. "port": 8443,
  177. "targetPort": 8443
  178. }
  179. ],
  180. "selector": {
  181. "deploymentConfig": "${APPLICATION_NAME}"
  182. }
  183. },
  184. "metadata": {
  185. "name": "secure-${APPLICATION_NAME}",
  186. "labels": {
  187. "application": "${APPLICATION_NAME}"
  188. },
  189. "annotations": {
  190. "description": "The web server's HTTPS port."
  191. }
  192. }
  193. },
  194. {
  195. "kind": "Service",
  196. "apiVersion": "v1",
  197. "spec": {
  198. "ports": [
  199. {
  200. "port": 61616,
  201. "targetPort": 61616
  202. }
  203. ],
  204. "selector": {
  205. "deploymentConfig": "${APPLICATION_NAME}-amq"
  206. }
  207. },
  208. "metadata": {
  209. "name": "${APPLICATION_NAME}-amq-tcp",
  210. "labels": {
  211. "application": "${APPLICATION_NAME}"
  212. },
  213. "annotations": {
  214. "description": "The broker's OpenWire port."
  215. }
  216. }
  217. },
  218. {
  219. "kind": "Route",
  220. "apiVersion": "v1",
  221. "id": "${APPLICATION_NAME}-http",
  222. "metadata": {
  223. "name": "${APPLICATION_NAME}",
  224. "labels": {
  225. "application": "${APPLICATION_NAME}"
  226. },
  227. "annotations": {
  228. "description": "Route for application's HTTP service."
  229. }
  230. },
  231. "spec": {
  232. "host": "${APPLICATION_DOMAIN}",
  233. "to": {
  234. "name": "${APPLICATION_NAME}"
  235. }
  236. }
  237. },
  238. {
  239. "kind": "Route",
  240. "apiVersion": "v1",
  241. "id": "${APPLICATION_NAME}-https",
  242. "metadata": {
  243. "name": "secure-${APPLICATION_NAME}",
  244. "labels": {
  245. "application": "${APPLICATION_NAME}"
  246. },
  247. "annotations": {
  248. "description": "Route for application's HTTPS service."
  249. }
  250. },
  251. "spec": {
  252. "host": "${APPLICATION_DOMAIN}",
  253. "to": {
  254. "name": "secure-${APPLICATION_NAME}"
  255. },
  256. "tls": {
  257. "termination": "passthrough"
  258. }
  259. }
  260. },
  261. {
  262. "kind": "ImageStream",
  263. "apiVersion": "v1",
  264. "metadata": {
  265. "name": "${APPLICATION_NAME}",
  266. "labels": {
  267. "application": "${APPLICATION_NAME}"
  268. }
  269. }
  270. },
  271. {
  272. "kind": "BuildConfig",
  273. "apiVersion": "v1",
  274. "metadata": {
  275. "name": "${APPLICATION_NAME}",
  276. "labels": {
  277. "application": "${APPLICATION_NAME}"
  278. }
  279. },
  280. "spec": {
  281. "source": {
  282. "type": "Git",
  283. "git": {
  284. "uri": "${SOURCE_REPOSITORY_URL}",
  285. "ref": "${SOURCE_REPOSITORY_REF}"
  286. },
  287. "contextDir": "${CONTEXT_DIR}"
  288. },
  289. "strategy": {
  290. "type": "Source",
  291. "sourceStrategy": {
  292. "forcePull": true,
  293. "from": {
  294. "kind": "ImageStreamTag",
  295. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  296. "name": "jboss-eap64-openshift:1.1"
  297. }
  298. }
  299. },
  300. "output": {
  301. "to": {
  302. "kind": "ImageStreamTag",
  303. "name": "${APPLICATION_NAME}:latest"
  304. }
  305. },
  306. "triggers": [
  307. {
  308. "type": "GitHub",
  309. "github": {
  310. "secret": "${GITHUB_WEBHOOK_SECRET}"
  311. }
  312. },
  313. {
  314. "type": "Generic",
  315. "generic": {
  316. "secret": "${GENERIC_WEBHOOK_SECRET}"
  317. }
  318. },
  319. {
  320. "type": "ImageChange",
  321. "imageChange": {}
  322. },
  323. {
  324. "type": "ConfigChange"
  325. }
  326. ]
  327. }
  328. },
  329. {
  330. "kind": "DeploymentConfig",
  331. "apiVersion": "v1",
  332. "metadata": {
  333. "name": "${APPLICATION_NAME}",
  334. "labels": {
  335. "application": "${APPLICATION_NAME}"
  336. }
  337. },
  338. "spec": {
  339. "strategy": {
  340. "type": "Recreate"
  341. },
  342. "triggers": [
  343. {
  344. "type": "ImageChange",
  345. "imageChangeParams": {
  346. "automatic": true,
  347. "containerNames": [
  348. "${APPLICATION_NAME}"
  349. ],
  350. "from": {
  351. "kind": "ImageStream",
  352. "name": "${APPLICATION_NAME}"
  353. }
  354. }
  355. },
  356. {
  357. "type": "ConfigChange"
  358. }
  359. ],
  360. "replicas": 1,
  361. "selector": {
  362. "deploymentConfig": "${APPLICATION_NAME}"
  363. },
  364. "template": {
  365. "metadata": {
  366. "name": "${APPLICATION_NAME}",
  367. "labels": {
  368. "deploymentConfig": "${APPLICATION_NAME}",
  369. "application": "${APPLICATION_NAME}"
  370. }
  371. },
  372. "spec": {
  373. "serviceAccount": "eap-service-account",
  374. "terminationGracePeriodSeconds": 60,
  375. "containers": [
  376. {
  377. "name": "${APPLICATION_NAME}",
  378. "image": "${APPLICATION_NAME}",
  379. "imagePullPolicy": "Always",
  380. "volumeMounts": [
  381. {
  382. "name": "eap-keystore-volume",
  383. "mountPath": "/etc/eap-secret-volume",
  384. "readOnly": true
  385. }
  386. ],
  387. "readinessProbe": {
  388. "exec": {
  389. "command": [
  390. "/bin/bash",
  391. "-c",
  392. "/opt/eap/bin/readinessProbe.sh"
  393. ]
  394. }
  395. },
  396. "ports": [
  397. {
  398. "name": "http",
  399. "containerPort": 8080,
  400. "protocol": "TCP"
  401. },
  402. {
  403. "name": "https",
  404. "containerPort": 8443,
  405. "protocol": "TCP"
  406. },
  407. {
  408. "name": "ping",
  409. "containerPort": 8888,
  410. "protocol": "TCP"
  411. }
  412. ],
  413. "env": [
  414. {
  415. "name": "MQ_SERVICE_PREFIX_MAPPING",
  416. "value": "${APPLICATION_NAME}-amq=MQ"
  417. },
  418. {
  419. "name": "MQ_JNDI",
  420. "value": "${MQ_JNDI}"
  421. },
  422. {
  423. "name": "MQ_USERNAME",
  424. "value": "${MQ_USERNAME}"
  425. },
  426. {
  427. "name": "MQ_PASSWORD",
  428. "value": "${MQ_PASSWORD}"
  429. },
  430. {
  431. "name": "MQ_PROTOCOL",
  432. "value": "tcp"
  433. },
  434. {
  435. "name": "MQ_QUEUES",
  436. "value": "${MQ_QUEUES}"
  437. },
  438. {
  439. "name": "MQ_TOPICS",
  440. "value": "${MQ_TOPICS}"
  441. },
  442. {
  443. "name": "OPENSHIFT_KUBE_PING_LABELS",
  444. "value": "application=${APPLICATION_NAME}"
  445. },
  446. {
  447. "name": "OPENSHIFT_KUBE_PING_NAMESPACE",
  448. "valueFrom": {
  449. "fieldRef": {
  450. "fieldPath": "metadata.namespace"
  451. }
  452. }
  453. },
  454. {
  455. "name": "EAP_HTTPS_KEYSTORE_DIR",
  456. "value": "/etc/eap-secret-volume"
  457. },
  458. {
  459. "name": "EAP_HTTPS_KEYSTORE",
  460. "value": "${EAP_HTTPS_KEYSTORE}"
  461. },
  462. {
  463. "name": "EAP_HTTPS_NAME",
  464. "value": "${EAP_HTTPS_NAME}"
  465. },
  466. {
  467. "name": "EAP_HTTPS_PASSWORD",
  468. "value": "${EAP_HTTPS_PASSWORD}"
  469. }
  470. ]
  471. }
  472. ],
  473. "volumes": [
  474. {
  475. "name": "eap-keystore-volume",
  476. "secret": {
  477. "secretName": "${EAP_HTTPS_SECRET}"
  478. }
  479. }
  480. ]
  481. }
  482. }
  483. }
  484. },
  485. {
  486. "kind": "DeploymentConfig",
  487. "apiVersion": "v1",
  488. "metadata": {
  489. "name": "${APPLICATION_NAME}-amq",
  490. "labels": {
  491. "application": "${APPLICATION_NAME}"
  492. }
  493. },
  494. "spec": {
  495. "strategy": {
  496. "type": "Recreate"
  497. },
  498. "triggers": [
  499. {
  500. "type": "ImageChange",
  501. "imageChangeParams": {
  502. "automatic": true,
  503. "containerNames": [
  504. "${APPLICATION_NAME}-amq"
  505. ],
  506. "from": {
  507. "kind": "ImageStreamTag",
  508. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  509. "name": "jboss-amq-62:1.1"
  510. }
  511. }
  512. },
  513. {
  514. "type": "ConfigChange"
  515. }
  516. ],
  517. "replicas": 1,
  518. "selector": {
  519. "deploymentConfig": "${APPLICATION_NAME}-amq"
  520. },
  521. "template": {
  522. "metadata": {
  523. "name": "${APPLICATION_NAME}-amq",
  524. "labels": {
  525. "deploymentConfig": "${APPLICATION_NAME}-amq",
  526. "application": "${APPLICATION_NAME}"
  527. }
  528. },
  529. "spec": {
  530. "terminationGracePeriodSeconds": 60,
  531. "containers": [
  532. {
  533. "name": "${APPLICATION_NAME}-amq",
  534. "image": "jboss-amq-62",
  535. "imagePullPolicy": "Always",
  536. "readinessProbe": {
  537. "exec": {
  538. "command": [
  539. "/bin/bash",
  540. "-c",
  541. "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\"'"
  542. ]
  543. }
  544. },
  545. "ports": [
  546. {
  547. "name": "amqp",
  548. "containerPort": 5672,
  549. "protocol": "TCP"
  550. },
  551. {
  552. "name": "amqp-ssl",
  553. "containerPort": 5671,
  554. "protocol": "TCP"
  555. },
  556. {
  557. "name": "mqtt",
  558. "containerPort": 1883,
  559. "protocol": "TCP"
  560. },
  561. {
  562. "name": "stomp",
  563. "containerPort": 61613,
  564. "protocol": "TCP"
  565. },
  566. {
  567. "name": "stomp-ssl",
  568. "containerPort": 61612,
  569. "protocol": "TCP"
  570. },
  571. {
  572. "name": "tcp",
  573. "containerPort": 61616,
  574. "protocol": "TCP"
  575. },
  576. {
  577. "name": "tcp-ssl",
  578. "containerPort": 61617,
  579. "protocol": "TCP"
  580. }
  581. ],
  582. "env": [
  583. {
  584. "name": "AMQ_USER",
  585. "value": "${MQ_USERNAME}"
  586. },
  587. {
  588. "name": "AMQ_PASSWORD",
  589. "value": "${MQ_PASSWORD}"
  590. },
  591. {
  592. "name": "AMQ_TRANSPORTS",
  593. "value": "${MQ_PROTOCOL}"
  594. },
  595. {
  596. "name": "AMQ_QUEUES",
  597. "value": "${MQ_QUEUES}"
  598. },
  599. {
  600. "name": "AMQ_TOPICS",
  601. "value": "${MQ_TOPICS}"
  602. },
  603. {
  604. "name": "AMQ_ADMIN_USERNAME",
  605. "value": "${AMQ_ADMIN_USERNAME}"
  606. },
  607. {
  608. "name": "AMQ_ADMIN_PASSWORD",
  609. "value": "${AMQ_ADMIN_PASSWORD}"
  610. }
  611. ]
  612. }
  613. ]
  614. }
  615. }
  616. }
  617. }
  618. ]
  619. }