eap70-basic-s2i.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "iconClass": "icon-jboss",
  7. "description": "Application template for EAP 7 applications built using S2I.",
  8. "tags": "eap,javaee,java,jboss,xpaas",
  9. "version": "1.3.2"
  10. },
  11. "name": "eap70-basic-s2i"
  12. },
  13. "labels": {
  14. "template": "eap70-basic-s2i",
  15. "xpaas": "1.3.2"
  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 http service route. Leave blank for default hostname, e.g.: <application-name>-<project>.<default-domain-suffix>",
  26. "name": "HOSTNAME_HTTP",
  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-developer/jboss-eap-quickstarts",
  34. "required": true
  35. },
  36. {
  37. "description": "Git branch/tag reference",
  38. "name": "SOURCE_REPOSITORY_REF",
  39. "value": "7.0.0.GA",
  40. "required": false
  41. },
  42. {
  43. "description": "Path within Git project to build; empty for root project directory.",
  44. "name": "CONTEXT_DIR",
  45. "value": "kitchensink",
  46. "required": false
  47. },
  48. {
  49. "description": "Queue names",
  50. "name": "MQ_QUEUES",
  51. "value": "",
  52. "required": false
  53. },
  54. {
  55. "description": "Topic names",
  56. "name": "MQ_TOPICS",
  57. "value": "",
  58. "required": false
  59. },
  60. {
  61. "description": "A-MQ cluster admin password",
  62. "name": "MQ_CLUSTER_PASSWORD",
  63. "from": "[a-zA-Z0-9]{8}",
  64. "generate": "expression",
  65. "required": true
  66. },
  67. {
  68. "description": "GitHub trigger secret",
  69. "name": "GITHUB_WEBHOOK_SECRET",
  70. "from": "[a-zA-Z0-9]{8}",
  71. "generate": "expression",
  72. "required": true
  73. },
  74. {
  75. "description": "Generic build trigger secret",
  76. "name": "GENERIC_WEBHOOK_SECRET",
  77. "from": "[a-zA-Z0-9]{8}",
  78. "generate": "expression",
  79. "required": true
  80. },
  81. {
  82. "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.",
  83. "name": "IMAGE_STREAM_NAMESPACE",
  84. "value": "openshift",
  85. "required": true
  86. },
  87. {
  88. "description": "JGroups cluster password",
  89. "name": "JGROUPS_CLUSTER_PASSWORD",
  90. "from": "[a-zA-Z0-9]{8}",
  91. "generate": "expression",
  92. "required": true
  93. },
  94. {
  95. "description": "Controls whether exploded deployment content should be automatically deployed",
  96. "name": "AUTO_DEPLOY_EXPLODED",
  97. "value": "false",
  98. "required": false
  99. }
  100. ],
  101. "objects": [
  102. {
  103. "kind": "Service",
  104. "apiVersion": "v1",
  105. "spec": {
  106. "ports": [
  107. {
  108. "port": 8080,
  109. "targetPort": 8080
  110. }
  111. ],
  112. "selector": {
  113. "deploymentConfig": "${APPLICATION_NAME}"
  114. }
  115. },
  116. "metadata": {
  117. "name": "${APPLICATION_NAME}",
  118. "labels": {
  119. "application": "${APPLICATION_NAME}"
  120. },
  121. "annotations": {
  122. "description": "The web server's http port."
  123. }
  124. }
  125. },
  126. {
  127. "kind": "Route",
  128. "apiVersion": "v1",
  129. "id": "${APPLICATION_NAME}-http",
  130. "metadata": {
  131. "name": "${APPLICATION_NAME}",
  132. "labels": {
  133. "application": "${APPLICATION_NAME}"
  134. },
  135. "annotations": {
  136. "description": "Route for application's http service."
  137. }
  138. },
  139. "spec": {
  140. "host": "${HOSTNAME_HTTP}",
  141. "to": {
  142. "name": "${APPLICATION_NAME}"
  143. }
  144. }
  145. },
  146. {
  147. "kind": "ImageStream",
  148. "apiVersion": "v1",
  149. "metadata": {
  150. "name": "${APPLICATION_NAME}",
  151. "labels": {
  152. "application": "${APPLICATION_NAME}"
  153. }
  154. }
  155. },
  156. {
  157. "kind": "BuildConfig",
  158. "apiVersion": "v1",
  159. "metadata": {
  160. "name": "${APPLICATION_NAME}",
  161. "labels": {
  162. "application": "${APPLICATION_NAME}"
  163. }
  164. },
  165. "spec": {
  166. "source": {
  167. "type": "Git",
  168. "git": {
  169. "uri": "${SOURCE_REPOSITORY_URL}",
  170. "ref": "${SOURCE_REPOSITORY_REF}"
  171. },
  172. "contextDir": "${CONTEXT_DIR}"
  173. },
  174. "strategy": {
  175. "type": "Source",
  176. "sourceStrategy": {
  177. "forcePull": true,
  178. "from": {
  179. "kind": "ImageStreamTag",
  180. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  181. "name": "jboss-eap70-openshift:1.4"
  182. }
  183. }
  184. },
  185. "output": {
  186. "to": {
  187. "kind": "ImageStreamTag",
  188. "name": "${APPLICATION_NAME}:latest"
  189. }
  190. },
  191. "triggers": [
  192. {
  193. "type": "GitHub",
  194. "github": {
  195. "secret": "${GITHUB_WEBHOOK_SECRET}"
  196. }
  197. },
  198. {
  199. "type": "Generic",
  200. "generic": {
  201. "secret": "${GENERIC_WEBHOOK_SECRET}"
  202. }
  203. },
  204. {
  205. "type": "ImageChange",
  206. "imageChange": {}
  207. },
  208. {
  209. "type": "ConfigChange"
  210. }
  211. ]
  212. }
  213. },
  214. {
  215. "kind": "DeploymentConfig",
  216. "apiVersion": "v1",
  217. "metadata": {
  218. "name": "${APPLICATION_NAME}",
  219. "labels": {
  220. "application": "${APPLICATION_NAME}"
  221. }
  222. },
  223. "spec": {
  224. "strategy": {
  225. "type": "Recreate"
  226. },
  227. "triggers": [
  228. {
  229. "type": "ImageChange",
  230. "imageChangeParams": {
  231. "automatic": true,
  232. "containerNames": [
  233. "${APPLICATION_NAME}"
  234. ],
  235. "from": {
  236. "kind": "ImageStreamTag",
  237. "name": "${APPLICATION_NAME}:latest"
  238. }
  239. }
  240. },
  241. {
  242. "type": "ConfigChange"
  243. }
  244. ],
  245. "replicas": 1,
  246. "selector": {
  247. "deploymentConfig": "${APPLICATION_NAME}"
  248. },
  249. "template": {
  250. "metadata": {
  251. "name": "${APPLICATION_NAME}",
  252. "labels": {
  253. "deploymentConfig": "${APPLICATION_NAME}",
  254. "application": "${APPLICATION_NAME}"
  255. }
  256. },
  257. "spec": {
  258. "terminationGracePeriodSeconds": 75,
  259. "containers": [
  260. {
  261. "name": "${APPLICATION_NAME}",
  262. "image": "${APPLICATION_NAME}",
  263. "imagePullPolicy": "Always",
  264. "lifecycle": {
  265. "preStop": {
  266. "exec": {
  267. "command": [
  268. "/opt/eap/bin/jboss-cli.sh",
  269. "-c",
  270. ":shutdown(timeout=60)"
  271. ]
  272. }
  273. }
  274. },
  275. "livenessProbe": {
  276. "exec": {
  277. "command": [
  278. "/bin/bash",
  279. "-c",
  280. "/opt/eap/bin/livenessProbe.sh"
  281. ]
  282. }
  283. },
  284. "readinessProbe": {
  285. "exec": {
  286. "command": [
  287. "/bin/bash",
  288. "-c",
  289. "/opt/eap/bin/readinessProbe.sh"
  290. ]
  291. }
  292. },
  293. "ports": [
  294. {
  295. "name": "jolokia",
  296. "containerPort": 8778,
  297. "protocol": "TCP"
  298. },
  299. {
  300. "name": "http",
  301. "containerPort": 8080,
  302. "protocol": "TCP"
  303. },
  304. {
  305. "name": "ping",
  306. "containerPort": 8888,
  307. "protocol": "TCP"
  308. }
  309. ],
  310. "env": [
  311. {
  312. "name": "OPENSHIFT_KUBE_PING_LABELS",
  313. "value": "application=${APPLICATION_NAME}"
  314. },
  315. {
  316. "name": "OPENSHIFT_KUBE_PING_NAMESPACE",
  317. "valueFrom": {
  318. "fieldRef": {
  319. "fieldPath": "metadata.namespace"
  320. }
  321. }
  322. },
  323. {
  324. "name": "MQ_CLUSTER_PASSWORD",
  325. "value": "${MQ_CLUSTER_PASSWORD}"
  326. },
  327. {
  328. "name": "MQ_QUEUES",
  329. "value": "${MQ_QUEUES}"
  330. },
  331. {
  332. "name": "MQ_TOPICS",
  333. "value": "${MQ_TOPICS}"
  334. },
  335. {
  336. "name": "JGROUPS_CLUSTER_PASSWORD",
  337. "value": "${JGROUPS_CLUSTER_PASSWORD}"
  338. },
  339. {
  340. "name": "AUTO_DEPLOY_EXPLODED",
  341. "value": "${AUTO_DEPLOY_EXPLODED}"
  342. }
  343. ]
  344. }
  345. ]
  346. }
  347. }
  348. }
  349. }
  350. ]
  351. }