jws30-tomcat7-https-s2i.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "annotations": {
  6. "iconClass": "icon-tomcat",
  7. "description": "Application template for JWS applications built using S2I.",
  8. "tags": "tomcat,tomcat7,java,jboss,xpaas",
  9. "version": "1.2.0"
  10. },
  11. "name": "jws30-tomcat7-https-s2i"
  12. },
  13. "labels": {
  14. "template": "jws30-tomcat7-https-s2i",
  15. "xpaas": "1.2.0"
  16. },
  17. "parameters": [
  18. {
  19. "description": "The name for the application.",
  20. "name": "APPLICATION_NAME",
  21. "value": "jws-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": "Custom hostname for https service route. Leave blank for default hostname, e.g.: secure-<application-name>-<project>.<default-domain-suffix>",
  32. "name": "HOSTNAME_HTTPS",
  33. "value": "",
  34. "required": false
  35. },
  36. {
  37. "description": "Git source URI for application",
  38. "name": "SOURCE_REPOSITORY_URL",
  39. "value": "https://github.com/jboss-openshift/openshift-quickstarts.git",
  40. "required": true
  41. },
  42. {
  43. "description": "Git branch/tag reference",
  44. "name": "SOURCE_REPOSITORY_REF",
  45. "value": "1.2",
  46. "required": false
  47. },
  48. {
  49. "description": "Path within Git project to build; empty for root project directory.",
  50. "name": "CONTEXT_DIR",
  51. "value": "tomcat-websocket-chat",
  52. "required": false
  53. },
  54. {
  55. "description": "The name of the secret containing the certificate files",
  56. "name": "JWS_HTTPS_SECRET",
  57. "value": "jws-app-secret",
  58. "required": true
  59. },
  60. {
  61. "description": "The name of the certificate file within the secret",
  62. "name": "JWS_HTTPS_CERTIFICATE",
  63. "value": "server.crt",
  64. "required": false
  65. },
  66. {
  67. "description": "The name of the certificate key file within the secret",
  68. "name": "JWS_HTTPS_CERTIFICATE_KEY",
  69. "value": "server.key",
  70. "required": false
  71. },
  72. {
  73. "description": "The certificate password",
  74. "name": "JWS_HTTPS_CERTIFICATE_PASSWORD",
  75. "value": "",
  76. "required": false
  77. },
  78. {
  79. "description": "JWS Admin User",
  80. "name": "JWS_ADMIN_USERNAME",
  81. "from": "[a-zA-Z0-9]{8}",
  82. "generate": "expression",
  83. "required": true
  84. },
  85. {
  86. "description": "JWS Admin Password",
  87. "name": "JWS_ADMIN_PASSWORD",
  88. "from": "[a-zA-Z0-9]{8}",
  89. "generate": "expression",
  90. "required": true
  91. },
  92. {
  93. "description": "GitHub trigger secret",
  94. "name": "GITHUB_WEBHOOK_SECRET",
  95. "from": "[a-zA-Z0-9]{8}",
  96. "generate": "expression",
  97. "required": true
  98. },
  99. {
  100. "description": "Generic build trigger secret",
  101. "name": "GENERIC_WEBHOOK_SECRET",
  102. "from": "[a-zA-Z0-9]{8}",
  103. "generate": "expression",
  104. "required": true
  105. },
  106. {
  107. "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.",
  108. "name": "IMAGE_STREAM_NAMESPACE",
  109. "value": "openshift",
  110. "required": true
  111. }
  112. ],
  113. "objects": [
  114. {
  115. "kind": "Service",
  116. "apiVersion": "v1",
  117. "spec": {
  118. "ports": [
  119. {
  120. "port": 8080,
  121. "targetPort": 8080
  122. }
  123. ],
  124. "selector": {
  125. "deploymentConfig": "${APPLICATION_NAME}"
  126. }
  127. },
  128. "metadata": {
  129. "name": "${APPLICATION_NAME}",
  130. "labels": {
  131. "application": "${APPLICATION_NAME}"
  132. },
  133. "annotations": {
  134. "description": "The web server's http port."
  135. }
  136. }
  137. },
  138. {
  139. "kind": "Service",
  140. "apiVersion": "v1",
  141. "spec": {
  142. "ports": [
  143. {
  144. "port": 8443,
  145. "targetPort": 8443
  146. }
  147. ],
  148. "selector": {
  149. "deploymentConfig": "${APPLICATION_NAME}"
  150. }
  151. },
  152. "metadata": {
  153. "name": "secure-${APPLICATION_NAME}",
  154. "labels": {
  155. "application": "${APPLICATION_NAME}"
  156. },
  157. "annotations": {
  158. "description": "The web server's https port."
  159. }
  160. }
  161. },
  162. {
  163. "kind": "Route",
  164. "apiVersion": "v1",
  165. "id": "${APPLICATION_NAME}-http",
  166. "metadata": {
  167. "name": "${APPLICATION_NAME}",
  168. "labels": {
  169. "application": "${APPLICATION_NAME}"
  170. },
  171. "annotations": {
  172. "description": "Route for application's http service."
  173. }
  174. },
  175. "spec": {
  176. "host": "${HOSTNAME_HTTP}",
  177. "to": {
  178. "name": "${APPLICATION_NAME}"
  179. }
  180. }
  181. },
  182. {
  183. "kind": "Route",
  184. "apiVersion": "v1",
  185. "id": "${APPLICATION_NAME}-https",
  186. "metadata": {
  187. "name": "secure-${APPLICATION_NAME}",
  188. "labels": {
  189. "application": "${APPLICATION_NAME}"
  190. },
  191. "annotations": {
  192. "description": "Route for application's https service."
  193. }
  194. },
  195. "spec": {
  196. "host": "${HOSTNAME_HTTPS}",
  197. "to": {
  198. "name": "secure-${APPLICATION_NAME}"
  199. },
  200. "tls": {
  201. "termination": "passthrough"
  202. }
  203. }
  204. },
  205. {
  206. "kind": "ImageStream",
  207. "apiVersion": "v1",
  208. "metadata": {
  209. "name": "${APPLICATION_NAME}",
  210. "labels": {
  211. "application": "${APPLICATION_NAME}"
  212. }
  213. }
  214. },
  215. {
  216. "kind": "BuildConfig",
  217. "apiVersion": "v1",
  218. "metadata": {
  219. "name": "${APPLICATION_NAME}",
  220. "labels": {
  221. "application": "${APPLICATION_NAME}"
  222. }
  223. },
  224. "spec": {
  225. "source": {
  226. "type": "Git",
  227. "git": {
  228. "uri": "${SOURCE_REPOSITORY_URL}",
  229. "ref": "${SOURCE_REPOSITORY_REF}"
  230. },
  231. "contextDir": "${CONTEXT_DIR}"
  232. },
  233. "strategy": {
  234. "type": "Source",
  235. "sourceStrategy": {
  236. "forcePull": true,
  237. "from": {
  238. "kind": "ImageStreamTag",
  239. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  240. "name": "jboss-webserver30-tomcat7-openshift:1.2"
  241. }
  242. }
  243. },
  244. "output": {
  245. "to": {
  246. "kind": "ImageStreamTag",
  247. "name": "${APPLICATION_NAME}:latest"
  248. }
  249. },
  250. "triggers": [
  251. {
  252. "type": "GitHub",
  253. "github": {
  254. "secret": "${GITHUB_WEBHOOK_SECRET}"
  255. }
  256. },
  257. {
  258. "type": "Generic",
  259. "generic": {
  260. "secret": "${GENERIC_WEBHOOK_SECRET}"
  261. }
  262. },
  263. {
  264. "type": "ImageChange",
  265. "imageChange": {}
  266. },
  267. {
  268. "type": "ConfigChange"
  269. }
  270. ]
  271. }
  272. },
  273. {
  274. "kind": "DeploymentConfig",
  275. "apiVersion": "v1",
  276. "metadata": {
  277. "name": "${APPLICATION_NAME}",
  278. "labels": {
  279. "application": "${APPLICATION_NAME}"
  280. }
  281. },
  282. "spec": {
  283. "strategy": {
  284. "type": "Recreate"
  285. },
  286. "triggers": [
  287. {
  288. "type": "ImageChange",
  289. "imageChangeParams": {
  290. "automatic": true,
  291. "containerNames": [
  292. "${APPLICATION_NAME}"
  293. ],
  294. "from": {
  295. "kind": "ImageStream",
  296. "name": "${APPLICATION_NAME}"
  297. }
  298. }
  299. },
  300. {
  301. "type": "ConfigChange"
  302. }
  303. ],
  304. "replicas": 1,
  305. "selector": {
  306. "deploymentConfig": "${APPLICATION_NAME}"
  307. },
  308. "template": {
  309. "metadata": {
  310. "name": "${APPLICATION_NAME}",
  311. "labels": {
  312. "deploymentConfig": "${APPLICATION_NAME}",
  313. "application": "${APPLICATION_NAME}"
  314. }
  315. },
  316. "spec": {
  317. "serviceAccountName": "jws-service-account",
  318. "terminationGracePeriodSeconds": 60,
  319. "containers": [
  320. {
  321. "name": "${APPLICATION_NAME}",
  322. "image": "${APPLICATION_NAME}",
  323. "imagePullPolicy": "Always",
  324. "readinessProbe": {
  325. "exec": {
  326. "command": [
  327. "/bin/bash",
  328. "-c",
  329. "curl -s -u ${JWS_ADMIN_USERNAME}:${JWS_ADMIN_PASSWORD} 'http://localhost:8080/manager/jmxproxy/?get=Catalina%3Atype%3DServer&att=stateName' |grep -iq 'stateName *= *STARTED'"
  330. ]
  331. }
  332. },
  333. "volumeMounts": [
  334. {
  335. "name": "jws-certificate-volume",
  336. "mountPath": "/etc/jws-secret-volume",
  337. "readOnly": true
  338. }
  339. ],
  340. "ports": [
  341. {
  342. "name": "jolokia",
  343. "containerPort": 8778,
  344. "protocol": "TCP"
  345. },
  346. {
  347. "name": "http",
  348. "containerPort": 8080,
  349. "protocol": "TCP"
  350. },
  351. {
  352. "name": "https",
  353. "containerPort": 8443,
  354. "protocol": "TCP"
  355. }
  356. ],
  357. "env": [
  358. {
  359. "name": "JWS_HTTPS_CERTIFICATE_DIR",
  360. "value": "/etc/jws-secret-volume"
  361. },
  362. {
  363. "name": "JWS_HTTPS_CERTIFICATE",
  364. "value": "${JWS_HTTPS_CERTIFICATE}"
  365. },
  366. {
  367. "name": "JWS_HTTPS_CERTIFICATE_KEY",
  368. "value": "${JWS_HTTPS_CERTIFICATE_KEY}"
  369. },
  370. {
  371. "name": "JWS_HTTPS_CERTIFICATE_PASSWORD",
  372. "value": "${JWS_HTTPS_CERTIFICATE_PASSWORD}"
  373. },
  374. {
  375. "name": "JWS_ADMIN_USERNAME",
  376. "value": "${JWS_ADMIN_USERNAME}"
  377. },
  378. {
  379. "name": "JWS_ADMIN_PASSWORD",
  380. "value": "${JWS_ADMIN_PASSWORD}"
  381. }
  382. ]
  383. }
  384. ],
  385. "volumes": [
  386. {
  387. "name": "jws-certificate-volume",
  388. "secret": {
  389. "secretName": "${JWS_HTTPS_SECRET}"
  390. }
  391. }
  392. ]
  393. }
  394. }
  395. }
  396. }
  397. ]
  398. }