jws30-tomcat7-https-s2i.json 14 KB

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