mmistretta
2020-02-25 d732bfe211220fcd877f496d0db941a857ece6ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
{
  "apiVersion": "template.openshift.io/v1",
  "kind": "Template",
  "metadata": {
    "annotations": {
      "openshift.io/display-name": "Red Hat Fuse 7.5 Camel on Spring Boot with XA Transactions",
      "openshift.io/provider-display-name": "Red Hat, Inc.",
      "description": "Spring Boot, Camel and XA Transactions. This example demonstrates how to run a Camel Service on Spring-Boot that supports XA transactions on two external transactional resources: a JMS resource (A-MQ) and a database (PostgreSQL). This quickstart requires the PostgreSQL database and the A-MQ broker have been deployed and running first, one simple way to run them is to use the templates provided in the Openshift service catalog",
      "tags": "quickstart,java,springboot,fis,jboss-fuse",
      "iconClass": "icon-rh-integration",
      "version": "1.5"
    },
    "name": "s2i-fuse75-spring-boot-camel-xa"
  },
  "labels": {
    "template": "s2i-fuse75-spring-boot-camel-xa"
  },
  "parameters": [
    {
      "name": "APP_NAME",
      "displayName": "Application Name",
      "required": true,
      "value": "s2i-fuse75-xa",
      "description": "The name assigned to the application (max 20 characters)."
    },
    {
      "name": "GIT_REPO",
      "displayName": "Git Repository URL",
      "required": true,
      "value": "https://github.com/jboss-fuse/spring-boot-camel-xa.git",
      "description": "The URL of the repository with your application source code."
    },
    {
      "name": "GIT_REF",
      "displayName": "Git Reference",
      "value": "spring-boot-camel-xa-1.0.0.fuse-750020-redhat-00005",
      "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
    },
    {
      "name": "BROKER_HOST",
      "displayName": "A-MQ Broker Service",
      "required": true,
      "value": "broker-amq-tcp",
      "description": "Set this to the name of the TCP service of the A-MQ broker. You may need to create a broker first."
    },
    {
      "name": "BROKER_USERNAME",
      "displayName": "A-MQ Broker Username",
      "required": true,
      "description": "The username used to authenticate with the A-MQ broker."
    },
    {
      "name": "BROKER_PASSWORD",
      "displayName": "A-MQ Broker Password",
      "required": true,
      "description": "The password used to authenticate with the A-MQ broker."
    },
    {
      "name": "DATABASE_HOST",
      "displayName": "PostgreSQL Service",
      "required": true,
      "value": "postgresql",
      "description": "Set this to the name of the PostgreSQL service. You may need to create the database first."
    },
    {
      "name": "DATABASE_USERNAME",
      "displayName": "PostgreSQL Username",
      "required": true,
      "description": "The username used to authenticate with the PostgreSQL database."
    },
    {
      "name": "DATABASE_PASSWORD",
      "displayName": "PostgreSQL Password",
      "required": true,
      "description": "The password used to authenticate with the PostgreSQL database."
    },
    {
      "name": "VOLUME_SIZE",
      "displayName": "Volume size for transaction log",
      "required": true,
      "value": "1Gi",
      "description": "The size of the volume used to store the transaction log."
    },
    {
      "name": "BUILDER_VERSION",
      "displayName": "Builder version",
      "value": "1.5",
      "description": "The version of the Fuse S2I builder image to use."
    },
    {
      "name": "APP_VERSION",
      "displayName": "Application Version",
      "value": "1.0.0.fuse-750020-redhat-00005",
      "description": "The application version."
    },
    {
      "name": "MAVEN_ARGS",
      "displayName": "Maven Arguments",
      "value": "package -DskipTests -Dfabric8.skip -e -B",
      "description": "Arguments passed to mvn in the build."
    },
    {
      "name": "MAVEN_ARGS_APPEND",
      "displayName": "Extra Maven Arguments",
      "description": "Extra arguments passed to mvn, e.g. for multi-module builds."
    },
    {
      "name": "ARTIFACT_DIR",
      "displayName": "Maven build directory",
      "description": "Directory of the artifact to be built, e.g. for multi-module builds."
    },
    {
      "name": "IMAGE_STREAM_NAMESPACE",
      "displayName": "Image Stream Namespace",
      "value": "openshift",
      "required": true,
      "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."
    },
    {
      "name": "BUILD_SECRET",
      "displayName": "Git Build Secret",
      "generate": "expression",
      "description": "The secret needed to trigger a build.",
      "from": "[a-zA-Z0-9]{40}"
    },
    {
      "name": "CPU_REQUEST",
      "displayName": "CPU request",
      "value": "0.2",
      "required": true,
      "description": "The amount of CPU to request."
    },
    {
      "name": "MEMORY_REQUEST",
      "displayName": "Memory request",
      "value": "256Mi",
      "required": true,
      "description": "The amount of memory required for the container to run."
    },
    {
      "name": "CPU_LIMIT",
      "displayName": "CPU limit",
      "value": "1.0",
      "required": true,
      "description": "The amount of CPU the container is limited to use."
    },
    {
      "name": "MEMORY_LIMIT",
      "displayName": "Memory limit",
      "value": "256Mi",
      "required": true,
      "description": "The amount of memory the container is limited to use."
    },
    {
      "name": "BUILD_MEMORY_REQUEST",
      "displayName": "Build Memory request",
      "value": "0.7G",
      "required": true,
      "description": "The amount of memory to request for builds."
    },
    {
      "name": "BUILD_MEMORY_LIMIT",
      "displayName": "Build Memory limit",
      "value": "0.8G",
      "required": true,
      "description": "The amount of memory the build container is limited to use."
    }
  ],
  "objects": [
    {
      "kind": "ImageStream",
      "apiVersion": "v1",
      "metadata": {
        "name": "${APP_NAME}",
        "creationTimestamp": null,
        "labels": {
          "component": "${APP_NAME}",
          "group": "quickstarts",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}"
        }
      },
      "spec": {
        "lookupPolicy": {
          "local": true
        }
      },
      "status": {
        "dockerImageRepository": ""
      }
    },
    {
      "kind": "BuildConfig",
      "apiVersion": "v1",
      "metadata": {
        "name": "${APP_NAME}",
        "creationTimestamp": null,
        "labels": {
          "component": "${APP_NAME}",
          "group": "quickstarts",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}"
        }
      },
      "spec": {
        "triggers": [
          {
            "type": "GitHub",
            "github": {
              "secret": "${BUILD_SECRET}"
            }
          },
          {
            "type": "Generic",
            "generic": {
              "secret": "${BUILD_SECRET}"
            }
          },
          {
            "type": "ConfigChange"
          },
          {
            "type": "ImageChange",
            "imageChange": {}
          }
        ],
        "source": {
          "type": "Git",
          "git": {
            "uri": "${GIT_REPO}",
            "ref": "${GIT_REF}"
          }
        },
        "strategy": {
          "type": "Source",
          "sourceStrategy": {
            "from": {
              "kind": "ImageStreamTag",
              "namespace": "${IMAGE_STREAM_NAMESPACE}",
              "name": "fuse7-java-openshift:${BUILDER_VERSION}"
            },
            "forcePull": true,
            "incremental": true,
            "env": [
              {
                "name": "BUILD_LOGLEVEL",
                "value": "5"
              },
              {
                "name": "ARTIFACT_DIR",
                "value": "${ARTIFACT_DIR}"
              },
              {
                "name": "MAVEN_ARGS",
                "value": "${MAVEN_ARGS}"
              },
              {
                "name": "MAVEN_ARGS_APPEND",
                "value": "${MAVEN_ARGS_APPEND}"
              }
            ]
          }
        },
        "output": {
          "to": {
            "kind": "ImageStreamTag",
            "name": "${APP_NAME}:latest"
          }
        },
        "resources": {
          "requests": {
            "memory": "${BUILD_MEMORY_REQUEST}"
          },
          "limits": {
            "memory": "${BUILD_MEMORY_LIMIT}"
          }
        }
      },
      "status": {
        "lastVersion": 0
      }
    },
    {
      "kind": "StatefulSet",
      "apiVersion": "apps/v1beta1",
      "metadata": {
        "name": "${APP_NAME}",
        "labels": {
          "component": "${APP_NAME}",
          "group": "quickstarts",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}"
        },
        "annotations": {
          "image.openshift.io/triggers": "[{\"from\":{\"kind\":\"ImageStreamTag\",\"name\":\"${APP_NAME}:latest\"},\"fieldPath\":\"spec.template.spec.containers[?(@.name==\\\"${APP_NAME}\\\")].image\"}]"
        }
      },
      "spec": {
        "podManagementPolicy": "Parallel",
        "updateStrategy": {
          "type": "RollingUpdate"
        },
        "replicas": 1,
        "selector": {
          "matchLabels": {
            "app": "${APP_NAME}",
            "provider": "s2i",
            "group": "quickstarts"
          }
        },
        "serviceName": "${APP_NAME}-headless",
        "template": {
          "metadata": {
            "labels": {
              "component": "${APP_NAME}",
              "app": "${APP_NAME}",
              "provider": "s2i",
              "version": "${APP_VERSION}",
              "group": "quickstarts"
            }
          },
          "spec": {
            "containers": [
              {
                "env": [
                  {
                    "name": "CLUSTER_RECOVERY_ENABLED",
                    "value": "true"
                  },
                  {
                    "name": "CLUSTER_BASE_DIR",
                    "value": "/var/transaction/data"
                  },
                  {
                    "name": "CLUSTER_NAME",
                    "value": "${APP_NAME}"
                  },
                  {
                    "name": "CLUSTER_NODENAME",
                    "valueFrom": {
                      "fieldRef": {
                        "apiVersion": "v1",
                        "fieldPath": "metadata.name"
                      }
                    }
                  },
                  {
                    "name": "BROKER_HOST",
                    "value": "${BROKER_HOST}"
                  },
                  {
                    "name": "BROKER_USERNAME",
                    "value": "${BROKER_USERNAME}"
                  },
                  {
                    "name": "BROKER_PASSWORD",
                    "value": "${BROKER_PASSWORD}"
                  },
                  {
                    "name": "DATABASE_HOST",
                    "value": "${DATABASE_HOST}"
                  },
                  {
                    "name": "DATABASE_USERNAME",
                    "value": "${DATABASE_USERNAME}"
                  },
                  {
                    "name": "DATABASE_PASSWORD",
                    "value": "${DATABASE_PASSWORD}"
                  },
                  {
                    "name": "KUBERNETES_NAMESPACE",
                    "valueFrom": {
                      "fieldRef": {
                        "fieldPath": "metadata.namespace"
                      }
                    }
                  }
                ],
                "image": "${APP_NAME}:latest",
                "imagePullPolicy": "Always",
                "livenessProbe": {
                  "httpGet": {
                    "path": "/health",
                    "port": 8080,
                    "scheme": "HTTP"
                  },
                  "initialDelaySeconds": 180
                },
                "name": "${APP_NAME}",
                "ports": [
                  {
                    "containerPort": 8080,
                    "name": "http",
                    "protocol": "TCP"
                  },
                  {
                    "containerPort": 8778,
                    "name": "jolokia",
                    "protocol": "TCP"
                  }
                ],
                "readinessProbe": {
                  "httpGet": {
                    "path": "/health",
                    "port": 8080,
                    "scheme": "HTTP"
                  },
                  "initialDelaySeconds": 10
                },
                "resources": {
                  "limits": {
                    "cpu": "1.0",
                    "memory": "256Mi"
                  },
                  "requests": {
                    "cpu": "0.2",
                    "memory": "256Mi"
                  }
                },
                "securityContext": {
                  "privileged": false
                },
                "volumeMounts": [
                  {
                    "mountPath": "/var/transaction/data",
                    "name": "${APP_NAME}-data"
                  }
                ]
              }
            ],
            "serviceAccountName": "${APP_NAME}",
            "terminationGracePeriodSeconds": 180,
            "volumes": [
              {
                "name": "${APP_NAME}-data",
                "persistentVolumeClaim": {
                  "claimName": "${APP_NAME}"
                }
              }
            ]
          }
        }
      }
    },
    {
      "apiVersion": "v1",
      "kind": "Service",
      "metadata": {
        "labels": {
          "component": "${APP_NAME}",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}",
          "group": "quickstarts"
        },
        "name": "${APP_NAME}"
      },
      "spec": {
        "ports": [
          {
            "name": "http",
            "port": 8080,
            "protocol": "TCP",
            "targetPort": 8080
          }
        ],
        "selector": {
          "app": "${APP_NAME}",
          "provider": "s2i",
          "group": "quickstarts"
        }
      }
    },
    {
      "apiVersion" : "v1",
      "kind" : "Service",
      "metadata" : {
        "labels": {
          "component": "${APP_NAME}",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}",
          "group": "quickstarts"
        },
        "name" : "${APP_NAME}-headless"
      },
      "spec" : {
        "clusterIP" : "None",
        "ports" : [ {
          "name" : "http",
          "port" : 8080,
          "protocol" : "TCP",
          "targetPort" : 8080
        } ],
        "selector" : {
          "app" : "${APP_NAME}",
          "group" : "quickstarts",
          "provider" : "s2i"
        }
      }
    },
    {
      "apiVersion" : "route.openshift.io/v1",
      "kind" : "Route",
      "metadata" : {
        "labels" : {
          "component" : "${APP_NAME}",
          "app" : "${APP_NAME}",
          "provider" : "s2i",
          "version" : "${APP_VERSION}",
          "group" : "quickstarts"
        },
        "name" : "${APP_NAME}"
      },
      "spec" : {
        "port" : {
          "targetPort" : 8080
        },
        "to" : {
          "kind" : "Service",
          "name" : "${APP_NAME}"
        }
      }
    },
    {
      "apiVersion": "v1",
      "kind": "ServiceAccount",
      "metadata": {
        "labels": {
          "component": "${APP_NAME}",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}",
          "group": "quickstarts"
        },
        "name": "${APP_NAME}"
      }
    },
    {
      "apiVersion": "v1",
      "kind": "RoleBinding",
      "metadata": {
        "labels": {
          "component": "${APP_NAME}",
          "app": "${APP_NAME}",
          "provider": "s2i",
          "version": "${APP_VERSION}",
          "group": "quickstarts"
        },
        "name": "${APP_NAME}"
      },
      "roleRef": {
        "name": "edit"
      },
      "subjects": [
        {
          "kind": "ServiceAccount",
          "name": "${APP_NAME}"
        }
      ]
    },
    {
      "apiVersion": "v1",
      "kind": "PersistentVolumeClaim",
      "metadata": {
        "labels": {
          "component": "${APP_NAME}",
          "app": "${APP_NAME}",
          "group": "quickstarts",
          "provider": "s2i",
          "version": "${APP_VERSION}"
        },
        "name": "${APP_NAME}"
      },
      "spec": {
        "accessModes": [
          "ReadWriteMany"
        ],
        "resources": {
          "requests": {
            "storage": "${VOLUME_SIZE}"
          }
        }
      }
    }
  ]
}