spring-boot-camel-rest-sql-template.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. {
  2. "apiVersion": "v1",
  3. "kind": "Template",
  4. "metadata": {
  5. "annotations": {
  6. "description": "Spring Boot, Camel REST DSL and MySQL QuickStart. This quickstart demonstrates how to connect a Spring Boot application to a MySQL database and expose a REST API with Camel on OpenShift. In this example we will use two containers, one container to run as a MySQL server, and another as a client to the database, where the Camel routes are running. This quickstart requires the MySQL server to be deployed and started first.",
  7. "tags": "quickstart,java,springboot,fis",
  8. "iconClass": "icon-jboss",
  9. "version": "2.0"
  10. },
  11. "name": "s2i-spring-boot-camel-rest-sql"
  12. },
  13. "labels": {
  14. "template": "s2i-spring-boot-camel-rest-sql"
  15. },
  16. "parameters": [
  17. {
  18. "name": "APP_NAME",
  19. "displayName": "Application Name",
  20. "required": true,
  21. "value": "s2i-spring-boot-camel-rest-sql",
  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-rest-sql.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-rest-sql-1.0.0.redhat-000055",
  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_NAME",
  39. "displayName": "Service Name",
  40. "value": "camel-rest-sql",
  41. "description": "Exposed service name."
  42. },
  43. {
  44. "name": "MYSQL_SERVICE_NAME",
  45. "displayName": "MySQL Server Service",
  46. "required": true,
  47. "value": "mysql",
  48. "description": "Set this to the name of the TCP service of the MySQL server. You may need to create a server first."
  49. },
  50. {
  51. "name": "MYSQL_SERVICE_DATABASE",
  52. "displayName": "MySQL Server Database",
  53. "value": "sampledb",
  54. "description": "The database hosted by the MySQL server to be used by the application."
  55. },
  56. {
  57. "name": "MYSQL_SERVICE_USERNAME",
  58. "displayName": "MySQL Server Username",
  59. "description": "The username used to authenticate with the MySQL server. Leave it empty if authentication is disabled."
  60. },
  61. {
  62. "name": "MYSQL_SERVICE_PASSWORD",
  63. "displayName": "MySQL Server Password",
  64. "description": "The password used to authenticate with the MySQL server. Leave it empty if authentication is disabled."
  65. },
  66. {
  67. "name": "BUILDER_VERSION",
  68. "displayName": "Builder version",
  69. "value": "2.0",
  70. "description": "The version of the FIS S2I builder image to use."
  71. },
  72. {
  73. "name": "APP_VERSION",
  74. "displayName": "Application Version",
  75. "value": "1.0.0.redhat-000055",
  76. "description": "The application version."
  77. },
  78. {
  79. "name": "MAVEN_ARGS",
  80. "displayName": "Maven Arguments",
  81. "value": "package -DskipTests -Dfabric8.skip -e -B",
  82. "description": "Arguments passed to mvn in the build."
  83. },
  84. {
  85. "name": "MAVEN_ARGS_APPEND",
  86. "displayName": "Extra Maven Arguments",
  87. "description": "Extra arguments passed to mvn, e.g. for multi-module builds."
  88. },
  89. {
  90. "name": "ARTIFACT_DIR",
  91. "displayName": "Maven build directory",
  92. "description": "Directory of the artifact to be built, e.g. for multi-module builds."
  93. },
  94. {
  95. "name": "IMAGE_STREAM_NAMESPACE",
  96. "displayName": "Image Stream Namespace",
  97. "value": "openshift",
  98. "required": true,
  99. "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."
  100. },
  101. {
  102. "name": "BUILD_SECRET",
  103. "displayName": "Git Build Secret",
  104. "generate": "expression",
  105. "description": "The secret needed to trigger a build.",
  106. "from": "[a-zA-Z0-9]{40}"
  107. },
  108. {
  109. "name": "CPU_REQUEST",
  110. "displayName": "CPU request",
  111. "value": "0.2",
  112. "required": true,
  113. "description": "The amount of CPU to requests."
  114. },
  115. {
  116. "name": "CPU_LIMIT",
  117. "displayName": "CPU limit",
  118. "value": "1.0",
  119. "required": true,
  120. "description": "The amount of CPU the container is limited to use."
  121. }
  122. ],
  123. "objects": [
  124. {
  125. "apiVersion": "v1",
  126. "kind": "Route",
  127. "metadata": {
  128. "labels": {
  129. "component": "${APP_NAME}",
  130. "provider": "s2i",
  131. "project": "${APP_NAME}",
  132. "version": "${APP_VERSION}",
  133. "group": "quickstarts"
  134. },
  135. "name": "${SERVICE_NAME}-route"
  136. },
  137. "spec": {
  138. "to": {
  139. "kind": "Service",
  140. "name": "${SERVICE_NAME}"
  141. }
  142. }
  143. },
  144. {
  145. "apiVersion": "v1",
  146. "kind": "Service",
  147. "metadata": {
  148. "annotations": {
  149. },
  150. "labels": {
  151. "component": "${APP_NAME}",
  152. "provider": "s2i",
  153. "project": "${APP_NAME}",
  154. "version": "${APP_VERSION}",
  155. "group": "quickstarts"
  156. },
  157. "name": "${SERVICE_NAME}"
  158. },
  159. "spec": {
  160. "clusterIP": "None",
  161. "deprecatedPublicIPs": [],
  162. "ports": [
  163. {
  164. "port": 9411,
  165. "protocol": "TCP",
  166. "targetPort": 8080
  167. }
  168. ],
  169. "selector": {
  170. "project": "${APP_NAME}",
  171. "component": "${APP_NAME}",
  172. "provider": "s2i",
  173. "group": "quickstarts"
  174. }
  175. }
  176. },
  177. {
  178. "kind": "ImageStream",
  179. "apiVersion": "v1",
  180. "metadata": {
  181. "name": "${APP_NAME}",
  182. "creationTimestamp": null,
  183. "labels": {
  184. "component": "${APP_NAME}",
  185. "group": "quickstarts",
  186. "project": "${APP_NAME}",
  187. "provider": "s2i",
  188. "version": "${APP_VERSION}"
  189. }
  190. },
  191. "spec": {},
  192. "status": {
  193. "dockerImageRepository": ""
  194. }
  195. },
  196. {
  197. "kind": "BuildConfig",
  198. "apiVersion": "v1",
  199. "metadata": {
  200. "name": "${APP_NAME}",
  201. "creationTimestamp": null,
  202. "labels": {
  203. "component": "${APP_NAME}",
  204. "group": "quickstarts",
  205. "project": "${APP_NAME}",
  206. "provider": "s2i",
  207. "version": "${APP_VERSION}"
  208. }
  209. },
  210. "spec": {
  211. "triggers": [
  212. {
  213. "type": "GitHub",
  214. "github": {
  215. "secret": "${BUILD_SECRET}"
  216. }
  217. },
  218. {
  219. "type": "Generic",
  220. "generic": {
  221. "secret": "${BUILD_SECRET}"
  222. }
  223. },
  224. {
  225. "type": "ConfigChange"
  226. },
  227. {
  228. "type": "ImageChange",
  229. "imageChange": {}
  230. }
  231. ],
  232. "source": {
  233. "type": "Git",
  234. "git": {
  235. "uri": "${GIT_REPO}",
  236. "ref": "${GIT_REF}"
  237. }
  238. },
  239. "strategy": {
  240. "type": "Source",
  241. "sourceStrategy": {
  242. "from": {
  243. "kind": "ImageStreamTag",
  244. "namespace": "${IMAGE_STREAM_NAMESPACE}",
  245. "name": "fis-java-openshift:${BUILDER_VERSION}"
  246. },
  247. "forcePull": true,
  248. "incremental": true,
  249. "env": [
  250. {
  251. "name": "BUILD_LOGLEVEL",
  252. "value": "5"
  253. },
  254. {
  255. "name": "ARTIFACT_DIR",
  256. "value": "${ARTIFACT_DIR}"
  257. },
  258. {
  259. "name": "MAVEN_ARGS",
  260. "value": "${MAVEN_ARGS}"
  261. },
  262. {
  263. "name": "MAVEN_ARGS_APPEND",
  264. "value": "${MAVEN_ARGS_APPEND}"
  265. }
  266. ]
  267. }
  268. },
  269. "output": {
  270. "to": {
  271. "kind": "ImageStreamTag",
  272. "name": "${APP_NAME}:latest"
  273. }
  274. },
  275. "resources": {}
  276. },
  277. "status": {
  278. "lastVersion": 0
  279. }
  280. },
  281. {
  282. "kind": "DeploymentConfig",
  283. "apiVersion": "v1",
  284. "metadata": {
  285. "name": "${APP_NAME}",
  286. "creationTimestamp": null,
  287. "labels": {
  288. "component": "${APP_NAME}",
  289. "group": "quickstarts",
  290. "project": "${APP_NAME}",
  291. "provider": "s2i",
  292. "version": "${APP_VERSION}"
  293. }
  294. },
  295. "spec": {
  296. "strategy": {
  297. "resources": {}
  298. },
  299. "triggers": [
  300. {
  301. "type": "ConfigChange"
  302. },
  303. {
  304. "type": "ImageChange",
  305. "imageChangeParams": {
  306. "automatic": true,
  307. "containerNames": [
  308. "${APP_NAME}"
  309. ],
  310. "from": {
  311. "kind": "ImageStreamTag",
  312. "name": "${APP_NAME}:latest"
  313. }
  314. }
  315. }
  316. ],
  317. "replicas": 1,
  318. "selector": {
  319. "component": "${APP_NAME}",
  320. "deploymentconfig": "${APP_NAME}",
  321. "group": "quickstarts",
  322. "project": "${APP_NAME}",
  323. "provider": "s2i",
  324. "version": "${APP_VERSION}"
  325. },
  326. "template": {
  327. "metadata": {
  328. "creationTimestamp": null,
  329. "labels": {
  330. "component": "${APP_NAME}",
  331. "deploymentconfig": "${APP_NAME}",
  332. "group": "quickstarts",
  333. "project": "${APP_NAME}",
  334. "provider": "s2i",
  335. "version": "${APP_VERSION}"
  336. }
  337. },
  338. "spec": {
  339. "containers": [
  340. {
  341. "name": "${APP_NAME}",
  342. "image": "library/${APP_NAME}:latest",
  343. "readinessProbe" : {
  344. "httpGet" : {
  345. "path" : "/health",
  346. "port" : 8081
  347. },
  348. "initialDelaySeconds" : 10
  349. },
  350. "livenessProbe" : {
  351. "httpGet" : {
  352. "path" : "/health",
  353. "port" : 8081
  354. },
  355. "initialDelaySeconds" : 180
  356. },
  357. "ports": [
  358. {
  359. "containerPort": 8080,
  360. "name": "http"
  361. },
  362. {
  363. "containerPort": 8778,
  364. "name": "jolokia"
  365. }
  366. ],
  367. "env" : [ {
  368. "name" : "KUBERNETES_NAMESPACE",
  369. "valueFrom" : {
  370. "fieldRef" : {
  371. "fieldPath" : "metadata.namespace"
  372. }
  373. }
  374. } , {
  375. "name": "MYSQL_SERVICE_NAME",
  376. "value": "${MYSQL_SERVICE_NAME}"
  377. }, {
  378. "name": "MYSQL_SERVICE_DATABASE",
  379. "value": "${MYSQL_SERVICE_DATABASE}"
  380. }, {
  381. "name": "MYSQL_SERVICE_USERNAME",
  382. "value": "${MYSQL_SERVICE_USERNAME}"
  383. }, {
  384. "name": "MYSQL_SERVICE_PASSWORD",
  385. "value": "${MYSQL_SERVICE_PASSWORD}"
  386. } ],
  387. "resources": {
  388. "requests": {
  389. "cpu": "${CPU_REQUEST}"
  390. },
  391. "limits": {
  392. "cpu": "${CPU_LIMIT}"
  393. }
  394. }
  395. }
  396. ]
  397. }
  398. }
  399. },
  400. "status": {}
  401. }
  402. ]
  403. }