spring-boot-camel-config-template.json 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. {
  2. "apiVersion": "v1",
  3. "kind": "Template",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Spring Boot and Camel using ConfigMaps and Secrets. This quickstart demonstrates how to configure a Spring-Boot application using Openshift ConfigMaps and Secrets.",
  7. "tags": "quickstart,java,springboot,fis",
  8. "iconClass": "icon-jboss",
  9. "version": "2.0"
  10. },
  11. "name": "s2i-spring-boot-camel-config"
  12. },
  13. "labels": {
  14. "template": "s2i-spring-boot-camel-config"
  15. },
  16. "parameters": [
  17. {
  18. "name": "APP_NAME",
  19. "displayName": "Application Name",
  20. "required": true,
  21. "value": "s2i-spring-boot-camel-config",
  22. "description": "The name assigned to the application."
  23. },
  24. {
  25. "name": "GIT_REPO",
  26. "displayName": "Git Repository URL",
  27. "required": true,
  28. "value": "https://github.com/fabric8-quickstarts/spring-boot-camel-config.git",
  29. "description": "The URL of the repository with your application source code."
  30. },
  31. {
  32. "name": "GIT_REF",
  33. "displayName": "Git Reference",
  34. "value": "spring-boot-camel-config-1.0.0.redhat-000005",
  35. "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
  36. },
  37. {
  38. "name": "SERVICE_ACCOUNT_NAME",
  39. "displayName": "Service Account",
  40. "value": "qs-camel-config",
  41. "required": true,
  42. "description": "The Service Account that will be used to run the container. It must be already present in Openshift and have the view role."
  43. },
  44. {
  45. "name": "SECRET_NAME",
  46. "displayName": "Secret Name",
  47. "value": "camel-config",
  48. "required": true,
  49. "description": "The name of the Openshift Secret that will be used to configure the application. It must be already present in Openshift."
  50. },
  51. {
  52. "name": "CONFIGMAP_NAME",
  53. "displayName": "ConfigMap Name",
  54. "value": "camel-config",
  55. "required": true,
  56. "description": "The name of the Openshift ConfigMap that will be used to configure the application. It must be already present in Openshift."
  57. },
  58. {
  59. "name": "BUILDER_VERSION",
  60. "displayName": "Builder version",
  61. "value": "2.0",
  62. "description": "The version of the FIS S2I builder image to use."
  63. },
  64. {
  65. "name": "APP_VERSION",
  66. "displayName": "Application Version",
  67. "value": "1.0.0.redhat-000005",
  68. "description": "The application version."
  69. },
  70. {
  71. "name": "MAVEN_ARGS",
  72. "displayName": "Maven Arguments",
  73. "value": "package -DskipTests -Dfabric8.skip -e -B",
  74. "description": "Arguments passed to mvn in the build."
  75. },
  76. {
  77. "name": "MAVEN_ARGS_APPEND",
  78. "displayName": "Extra Maven Arguments",
  79. "description": "Extra arguments passed to mvn, e.g. for multi-module builds."
  80. },
  81. {
  82. "name": "ARTIFACT_DIR",
  83. "displayName": "Maven build directory",
  84. "description": "Directory of the artifact to be built, e.g. for multi-module builds."
  85. },
  86. {
  87. "name": "IMAGE_STREAM_NAMESPACE",
  88. "displayName": "Image Stream Namespace",
  89. "value": "openshift",
  90. "required": true,
  91. "description": "Namespace in which the Fuse ImageStreams 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."
  92. },
  93. {
  94. "name": "BUILD_SECRET",
  95. "displayName": "Git Build Secret",
  96. "generate": "expression",
  97. "description": "The secret needed to trigger a build.",
  98. "from": "[a-zA-Z0-9]{40}"
  99. }
  100. ],
  101. "objects": [
  102. {
  103. "kind": "ImageStream",
  104. "apiVersion": "v1",
  105. "metadata": {
  106. "name": "${APP_NAME}",
  107. "creationTimestamp": null,
  108. "labels": {
  109. "component": "${APP_NAME}",
  110. "group": "quickstarts",
  111. "project": "${APP_NAME}",
  112. "provider": "s2i",
  113. "version": "${APP_VERSION}"
  114. }
  115. },
  116. "spec": {},
  117. "status": {
  118. "dockerImageRepository": ""
  119. }
  120. },
  121. {
  122. "kind": "BuildConfig",
  123. "apiVersion": "v1",
  124. "metadata": {
  125. "name": "${APP_NAME}",
  126. "creationTimestamp": null,
  127. "labels": {
  128. "component": "${APP_NAME}",
  129. "group": "quickstarts",
  130. "project": "${APP_NAME}",
  131. "provider": "s2i",
  132. "version": "${APP_VERSION}"
  133. }
  134. },
  135. "spec": {
  136. "triggers": [
  137. {
  138. "type": "GitHub",
  139. "github": {
  140. "secret": "${BUILD_SECRET}"
  141. }
  142. },
  143. {
  144. "type": "Generic",
  145. "generic": {
  146. "secret": "${BUILD_SECRET}"
  147. }
  148. },
  149. {
  150. "type": "ConfigChange"
  151. },
  152. {
  153. "type": "ImageChange",
  154. "imageChange": {}
  155. }
  156. ],
  157. "source": {
  158. "type": "Git",
  159. "git": {
  160. "uri": "${GIT_REPO}",
  161. "ref": "${GIT_REF}"
  162. }
  163. },
  164. "strategy": {
  165. "type": "Source",
  166. "sourceStrategy": {
  167. "from": {
  168. "kind": "ImageStreamTag",
  169. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  170. "name": "fis-java-openshift:${BUILDER_VERSION}"
  171. },
  172. "forcePull": true,
  173. "incremental": true,
  174. "env": [
  175. {
  176. "name": "BUILD_LOGLEVEL",
  177. "value": "5"
  178. },
  179. {
  180. "name": "ARTIFACT_DIR",
  181. "value": "${ARTIFACT_DIR}"
  182. },
  183. {
  184. "name": "MAVEN_ARGS",
  185. "value": "${MAVEN_ARGS}"
  186. },
  187. {
  188. "name": "MAVEN_ARGS_APPEND",
  189. "value": "${MAVEN_ARGS_APPEND}"
  190. }
  191. ]
  192. }
  193. },
  194. "output": {
  195. "to": {
  196. "kind": "ImageStreamTag",
  197. "name": "${APP_NAME}:latest"
  198. }
  199. },
  200. "resources": {}
  201. },
  202. "status": {
  203. "lastVersion": 0
  204. }
  205. },
  206. {
  207. "kind": "DeploymentConfig",
  208. "apiVersion": "v1",
  209. "metadata": {
  210. "name": "${APP_NAME}",
  211. "creationTimestamp": null,
  212. "labels": {
  213. "component": "${APP_NAME}",
  214. "group": "quickstarts",
  215. "project": "${APP_NAME}",
  216. "provider": "s2i",
  217. "version": "${APP_VERSION}"
  218. }
  219. },
  220. "spec": {
  221. "strategy": {
  222. "resources": {}
  223. },
  224. "triggers": [
  225. {
  226. "type": "ConfigChange"
  227. },
  228. {
  229. "type": "ImageChange",
  230. "imageChangeParams": {
  231. "automatic": true,
  232. "containerNames": [
  233. "${APP_NAME}"
  234. ],
  235. "from": {
  236. "kind": "ImageStreamTag",
  237. "name": "${APP_NAME}:latest"
  238. }
  239. }
  240. }
  241. ],
  242. "replicas": 1,
  243. "selector": {
  244. "component": "${APP_NAME}",
  245. "deploymentconfig": "${APP_NAME}",
  246. "group": "quickstarts",
  247. "project": "${APP_NAME}",
  248. "provider": "s2i",
  249. "version": "${APP_VERSION}"
  250. },
  251. "template": {
  252. "metadata": {
  253. "creationTimestamp": null,
  254. "labels": {
  255. "component": "${APP_NAME}",
  256. "deploymentconfig": "${APP_NAME}",
  257. "group": "quickstarts",
  258. "project": "${APP_NAME}",
  259. "provider": "s2i",
  260. "version": "${APP_VERSION}"
  261. }
  262. },
  263. "spec": {
  264. "serviceAccountName": "${SERVICE_ACCOUNT_NAME}",
  265. "volumes": [
  266. {
  267. "name": "camel-config",
  268. "secret": {
  269. "secretName": "${SECRET_NAME}"
  270. }
  271. }
  272. ],
  273. "containers": [
  274. {
  275. "name": "${APP_NAME}",
  276. "image": "library/${APP_NAME}:latest",
  277. "readinessProbe" : {
  278. "httpGet" : {
  279. "path" : "/health",
  280. "port" : 8081
  281. },
  282. "initialDelaySeconds" : 10
  283. },
  284. "livenessProbe" : {
  285. "httpGet" : {
  286. "path" : "/health",
  287. "port" : 8081
  288. },
  289. "initialDelaySeconds" : 180
  290. },
  291. "ports": [
  292. {
  293. "containerPort": 8778,
  294. "name": "jolokia"
  295. }
  296. ],
  297. "env" : [ {
  298. "name" : "KUBERNETES_NAMESPACE",
  299. "valueFrom" : {
  300. "fieldRef" : {
  301. "fieldPath" : "metadata.namespace"
  302. }
  303. }
  304. }, {
  305. "name": "SPRING_CLOUD_KUBERNETES_SECRETS_NAME",
  306. "value": "${SECRET_NAME}"
  307. }, {
  308. "name": "SPRING_CLOUD_KUBERNETES_CONFIG_NAME",
  309. "value": "${CONFIGMAP_NAME}"
  310. } ],
  311. "resources": {},
  312. "volumeMounts": [
  313. {
  314. "name": "camel-config",
  315. "readOnly": true,
  316. "mountPath": "/etc/secrets/camel-config"
  317. }
  318. ]
  319. }
  320. ]
  321. }
  322. }
  323. },
  324. "status": {}
  325. }
  326. ]
  327. }