httpd.json 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. {
  2. "kind": "Template",
  3. "apiVersion": "v1",
  4. "metadata": {
  5. "name": "httpd-example",
  6. "annotations": {
  7. "openshift.io/display-name": "Httpd",
  8. "description": "An example Httpd application that serves static content. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/httpd-ex/blob/master/README.md.",
  9. "tags": "quickstart,httpd",
  10. "iconClass": "icon-apache",
  11. "template.openshift.io/long-description": "This template defines resources needed to develop a static application served by httpd, including a build configuration and application deployment configuration.",
  12. "template.openshift.io/provider-display-name": "Red Hat, Inc.",
  13. "template.openshift.io/documentation-url": "https://github.com/openshift/httpd-ex",
  14. "template.openshift.io/support-url": "https://access.redhat.com"
  15. }
  16. },
  17. "message": "The following service(s) have been created in your project: ${NAME}.\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/openshift/httpd-ex/blob/master/README.md.",
  18. "labels": {
  19. "template": "httpd-example"
  20. },
  21. "objects": [
  22. {
  23. "kind": "Service",
  24. "apiVersion": "v1",
  25. "metadata": {
  26. "name": "${NAME}",
  27. "annotations": {
  28. "description": "Exposes and load balances the application pods"
  29. }
  30. },
  31. "spec": {
  32. "ports": [
  33. {
  34. "name": "web",
  35. "port": 8080,
  36. "targetPort": 8080
  37. }
  38. ],
  39. "selector": {
  40. "name": "${NAME}"
  41. }
  42. }
  43. },
  44. {
  45. "kind": "Route",
  46. "apiVersion": "v1",
  47. "metadata": {
  48. "name": "${NAME}",
  49. "annotations": {
  50. "template.openshift.io/expose-uri": "http://{.spec.host}{.spec.path}"
  51. }
  52. },
  53. "spec": {
  54. "host": "${APPLICATION_DOMAIN}",
  55. "to": {
  56. "kind": "Service",
  57. "name": "${NAME}"
  58. }
  59. }
  60. },
  61. {
  62. "kind": "ImageStream",
  63. "apiVersion": "v1",
  64. "metadata": {
  65. "name": "${NAME}",
  66. "annotations": {
  67. "description": "Keeps track of changes in the application image"
  68. }
  69. }
  70. },
  71. {
  72. "kind": "BuildConfig",
  73. "apiVersion": "v1",
  74. "metadata": {
  75. "name": "${NAME}",
  76. "annotations": {
  77. "description": "Defines how to build the application"
  78. }
  79. },
  80. "spec": {
  81. "source": {
  82. "type": "Git",
  83. "git": {
  84. "uri": "${SOURCE_REPOSITORY_URL}",
  85. "ref": "${SOURCE_REPOSITORY_REF}"
  86. },
  87. "contextDir": "${CONTEXT_DIR}"
  88. },
  89. "strategy": {
  90. "type": "Source",
  91. "sourceStrategy": {
  92. "from": {
  93. "kind": "ImageStreamTag",
  94. "namespace": "${NAMESPACE}",
  95. "name": "httpd:2.4"
  96. }
  97. }
  98. },
  99. "output": {
  100. "to": {
  101. "kind": "ImageStreamTag",
  102. "name": "${NAME}:latest"
  103. }
  104. },
  105. "triggers": [
  106. {
  107. "type": "ImageChange"
  108. },
  109. {
  110. "type": "ConfigChange"
  111. },
  112. {
  113. "type": "GitHub",
  114. "github": {
  115. "secret": "${GITHUB_WEBHOOK_SECRET}"
  116. }
  117. },
  118. {
  119. "type": "Generic",
  120. "generic": {
  121. "secret": "${GENERIC_WEBHOOK_SECRET}"
  122. }
  123. }
  124. ]
  125. }
  126. },
  127. {
  128. "kind": "DeploymentConfig",
  129. "apiVersion": "v1",
  130. "metadata": {
  131. "name": "${NAME}",
  132. "annotations": {
  133. "description": "Defines how to deploy the application server"
  134. }
  135. },
  136. "spec": {
  137. "strategy": {
  138. "type": "Rolling"
  139. },
  140. "triggers": [
  141. {
  142. "type": "ImageChange",
  143. "imageChangeParams": {
  144. "automatic": true,
  145. "containerNames": [
  146. "httpd-example"
  147. ],
  148. "from": {
  149. "kind": "ImageStreamTag",
  150. "name": "${NAME}:latest"
  151. }
  152. }
  153. },
  154. {
  155. "type": "ConfigChange"
  156. }
  157. ],
  158. "replicas": 1,
  159. "selector": {
  160. "name": "${NAME}"
  161. },
  162. "template": {
  163. "metadata": {
  164. "name": "${NAME}",
  165. "labels": {
  166. "name": "${NAME}"
  167. }
  168. },
  169. "spec": {
  170. "containers": [
  171. {
  172. "name": "httpd-example",
  173. "image": " ",
  174. "ports": [
  175. {
  176. "containerPort": 8080
  177. }
  178. ],
  179. "readinessProbe": {
  180. "timeoutSeconds": 3,
  181. "initialDelaySeconds": 3,
  182. "httpGet": {
  183. "path": "/",
  184. "port": 8080
  185. }
  186. },
  187. "livenessProbe": {
  188. "timeoutSeconds": 3,
  189. "initialDelaySeconds": 30,
  190. "httpGet": {
  191. "path": "/",
  192. "port": 8080
  193. }
  194. },
  195. "resources": {
  196. "limits": {
  197. "memory": "${MEMORY_LIMIT}"
  198. }
  199. },
  200. "env": [
  201. ],
  202. "resources": {
  203. "limits": {
  204. "memory": "${MEMORY_LIMIT}"
  205. }
  206. }
  207. }
  208. ]
  209. }
  210. }
  211. }
  212. }
  213. ],
  214. "parameters": [
  215. {
  216. "name": "NAME",
  217. "displayName": "Name",
  218. "description": "The name assigned to all of the frontend objects defined in this template.",
  219. "required": true,
  220. "value": "httpd-example"
  221. },
  222. {
  223. "name": "NAMESPACE",
  224. "displayName": "Namespace",
  225. "description": "The OpenShift Namespace where the ImageStream resides.",
  226. "required": true,
  227. "value": "openshift"
  228. },
  229. {
  230. "name": "MEMORY_LIMIT",
  231. "displayName": "Memory Limit",
  232. "description": "Maximum amount of memory the container can use.",
  233. "required": true,
  234. "value": "512Mi"
  235. },
  236. {
  237. "name": "SOURCE_REPOSITORY_URL",
  238. "displayName": "Git Repository URL",
  239. "description": "The URL of the repository with your application source code.",
  240. "required": true,
  241. "value": "https://github.com/openshift/httpd-ex.git"
  242. },
  243. {
  244. "name": "SOURCE_REPOSITORY_REF",
  245. "displayName": "Git Reference",
  246. "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
  247. },
  248. {
  249. "name": "CONTEXT_DIR",
  250. "displayName": "Context Directory",
  251. "description": "Set this to the relative path to your project if it is not in the root of your repository."
  252. },
  253. {
  254. "name": "APPLICATION_DOMAIN",
  255. "displayName": "Application Hostname",
  256. "description": "The exposed hostname that will route to the httpd service, if left blank a value will be defaulted.",
  257. "value": ""
  258. },
  259. {
  260. "name": "GITHUB_WEBHOOK_SECRET",
  261. "displayName": "GitHub Webhook Secret",
  262. "description": "Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted.",
  263. "generate": "expression",
  264. "from": "[a-zA-Z0-9]{40}"
  265. },
  266. {
  267. "name": "GENERIC_WEBHOOK_SECRET",
  268. "displayName": "Generic Webhook Secret",
  269. "description": "A secret string used to configure the Generic webhook.",
  270. "generate": "expression",
  271. "from": "[a-zA-Z0-9]{40}"
  272. }
  273. ]
  274. }