karaf2-camel-rest-sql-template.json 12 KB

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