diff --git a/helm/README.md b/helm/README.md index 7b8687d..05aeb4a 100644 --- a/helm/README.md +++ b/helm/README.md @@ -13,7 +13,7 @@ All other Helm charts are optional. ## Set up Bobbycar from the Git repo -1. Clone the Bobbycar repo and navigate to helm subfolder +### 1. Clone the Bobbycar repo and navigate to helm subfolder ```sh git clone https://github.com/sa-mw-dach/bobbycar.git @@ -21,41 +21,54 @@ git clone https://github.com/sa-mw-dach/bobbycar.git cd bobbycar/helm/ ``` -2. Create a namespace +### 2. Create the namespace where you want to install the Bobbycar demo ```sh oc new-project bobbycar ``` -3. Edit the operator-group.yaml to match the correct namespace and apply. +### 3. Edit the operator-group.yaml to match the correct namespace and apply the file. ```sh oc apply -f operator-group.yaml ``` -4. Install *bobbycar-core-infra* chart +### 4. Install the *bobbycar-core-infra* Helm chart + +Edit the chart values.yaml and install the chart + +**Adjusting these fields to your environement is mandatory:** +- ocpDomain +- namespace + +You can leave the others as default values if you like. -Edit the bobbycar-core-infra Helm chart values.yaml, optionally validate the templates and install the chart ``` sh vi bobbycar-core-infra/values.yaml -helm template bobbycar-core-infra/ - helm install bobbycar-core-infra/ -g ``` Wait for around 2 minutes and verify that all components have been successfully installed. -5. Install *bobbycar-core-apps* chart +### 5. Install *bobbycar-core-apps* chart -Edit the bobbycar-core-apps Helm chart values.yaml, optionally validate the templates and install the chart. +Edit the chart values.yaml and install the chart. +**Adjusting these fields to your environement is mandatory:** +- ocpDomain +- ocpApi +- namespace +- datagrid.account.password +- dashboard.config.googleApiKey + +Get the datagrid password from the **bobbycar-dg-generated-secret** secret. + +You can leave the others as default values if you like. ```sh vi bobbycar-core-apps/values.yaml -helm template bobbycar-core-apps/ - helm install bobbycar-core-apps/ -g ``` Verify that all components have been successfully installed. diff --git a/helm/bobbycar-core-apps/Chart.yaml b/helm/bobbycar-core-apps/Chart.yaml index af3fb36..1b069e3 100644 --- a/helm/bobbycar-core-apps/Chart.yaml +++ b/helm/bobbycar-core-apps/Chart.yaml @@ -20,7 +20,7 @@ version: 0.1.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 4.5.18 +appVersion: 4.5.24 sources: - https://github.com/sa-mw-dach/bobbycar diff --git a/helm/bobbycar-core-apps/templates/cacheService-integration.yaml b/helm/bobbycar-core-apps/templates/cacheService-integration.yaml index 68b6b4c..f0cbbfe 100644 --- a/helm/bobbycar-core-apps/templates/cacheService-integration.yaml +++ b/helm/bobbycar-core-apps/templates/cacheService-integration.yaml @@ -1,13 +1,13 @@ apiVersion: camel.apache.org/v1 kind: Integration metadata: - name: {{ .Values.cacheService.name }} + name: cache-service labels: app.kubernetes.io/part-of: {{ .Values.appName }} spec: configuration: - type: secret - value: {{ .Values.cacheService.name }}-secret + value: cache-service-secret dependencies: - 'camel:undertow' - 'camel:infinispan' diff --git a/helm/bobbycar-core-apps/templates/cacheService-route.yaml b/helm/bobbycar-core-apps/templates/cacheService-route.yaml index 52ce31e..0c9c141 100644 --- a/helm/bobbycar-core-apps/templates/cacheService-route.yaml +++ b/helm/bobbycar-core-apps/templates/cacheService-route.yaml @@ -1,14 +1,14 @@ kind: Route apiVersion: route.openshift.io/v1 metadata: - name: {{ .Values.cacheService.name }} + name: cache-service labels: - camel.apache.org/integration: {{ .Values.cacheService.name }} + camel.apache.org/integration: cache-service spec: - host: {{ .Values.cacheService.name }}-{{ .Values.namespace }}.{{ .Values.ocpDomain }} + host: cache-service-{{ .Values.namespace }}.{{ .Values.ocpDomain }} to: kind: Service - name: {{ .Values.cacheService.name }} + name: cache-service weight: 100 port: targetPort: http diff --git a/helm/bobbycar-core-apps/templates/cacheService-secret.yaml b/helm/bobbycar-core-apps/templates/cacheService-secret.yaml index cc4b21e..63e7f4f 100644 --- a/helm/bobbycar-core-apps/templates/cacheService-secret.yaml +++ b/helm/bobbycar-core-apps/templates/cacheService-secret.yaml @@ -1,12 +1,12 @@ kind: Secret apiVersion: v1 metadata: - name: {{ .Values.cacheService.name }}-secret + name: cache-service-secret stringData: application.properties: |- - com.redhat.bobbycar.camelk.dg.car.cacheName: {{ .Values.kafka2datagrid.datagrid.cache.car }} - com.redhat.bobbycar.camelk.dg.zone.cacheName: {{ .Values.kafka2datagrid.datagrid.cache.zone }} - com.redhat.bobbycar.camelk.dg.host: {{ .Values.kafka2datagrid.datagrid.account.host }} - com.redhat.bobbycar.camelk.dg.password: {{ .Values.kafka2datagrid.datagrid.account.password }} - com.redhat.bobbycar.camelk.dg.user: {{ .Values.kafka2datagrid.datagrid.account.user }} + com.redhat.bobbycar.camelk.dg.car.cacheName: {{ .Values.datagrid.cache.car }} + com.redhat.bobbycar.camelk.dg.zone.cacheName: {{ .Values.datagrid.cache.zone }} + com.redhat.bobbycar.camelk.dg.host: bobbycar-dg + com.redhat.bobbycar.camelk.dg.password: {{ .Values.datagrid.account.password }} + com.redhat.bobbycar.camelk.dg.user: {{ .Values.datagrid.account.user }} type: Opaque \ No newline at end of file diff --git a/helm/bobbycar-core-apps/templates/cacheService-svc.yaml b/helm/bobbycar-core-apps/templates/cacheService-svc.yaml index a2d1766..92d5c56 100644 --- a/helm/bobbycar-core-apps/templates/cacheService-svc.yaml +++ b/helm/bobbycar-core-apps/templates/cacheService-svc.yaml @@ -1,10 +1,10 @@ kind: Service apiVersion: v1 metadata: - name: {{ .Values.cacheService.name }} + name: cache-service labels: camel.apache.org/generation: '1' - camel.apache.org/integration: {{ .Values.cacheService.name }} + camel.apache.org/integration: cache-service camel.apache.org/service.type: user spec: ports: @@ -13,6 +13,6 @@ spec: port: 80 targetPort: http selector: - camel.apache.org/integration: {{ .Values.cacheService.name }} + camel.apache.org/integration: cache-service type: ClusterIP sessionAffinity: None \ No newline at end of file diff --git a/helm/bobbycar-core-apps/templates/car-simulator-dc.yaml b/helm/bobbycar-core-apps/templates/car-simulator-dc.yaml index dd4ded2..15dac40 100644 --- a/helm/bobbycar-core-apps/templates/car-simulator-dc.yaml +++ b/helm/bobbycar-core-apps/templates/car-simulator-dc.yaml @@ -57,23 +57,23 @@ spec: - name: mp.messaging.incoming.zonechange.type value: 'smallrye-mqtt' - name: mp.messaging.incoming.zonechange.topic - value: {{ .Values.carSimulator.config.mqttZoneChangeTopic | quote }} + value: {{ .Values.mqtt.topic.mqttZoneChangeTopic | quote }} - name: mp.messaging.incoming.zonechange.host - value: {{ .Values.carSimulator.config.mqttHost | quote }} + value: 'bobbycar-amq-mqtt-all-0-svc' - name: mp.messaging.incoming.zonechange.port - value: {{ .Values.carSimulator.config.mqttPort | quote }} + value: '61616' - name: com.redhat.bobbycar.carsim.datagrid.url - value: 'http://{{ .Values.cacheService.name }}-{{ .Values.namespace }}.{{ .Values.ocpDomain }}' + value: 'http://cache-service-{{ .Values.namespace }}.{{ .Values.ocpDomain }}' - name: com.redhat.bobbycar.carsim.kafka.url - value: 'http://{{ .Values.carSimulator.config.kafkaBridgeServiceUrl }}' + value: 'http://bobbycar-{{ .Values.namespace }}.{{ .Values.ocpDomain }}' - name: mp.messaging.outgoing.enginemetrics.type value: 'smallrye-mqtt' - name: mp.messaging.outgoing.enginemetrics.topic - value: {{ .Values.carSimulator.config.mqttMetricsTopic | quote }} + value: {{ .Values.mqtt.topic.mqttMetricsTopic | quote }} - name: mp.messaging.outgoing.enginemetrics.host - value: {{ .Values.carSimulator.config.mqttHost | quote }} + value: 'bobbycar-amq-mqtt-all-0-svc' - name: mp.messaging.outgoing.enginemetrics.port - value: {{ .Values.carSimulator.config.mqttPort | quote }} + value: '61616' ports: - containerPort: 8080 name: http diff --git a/helm/bobbycar-core-apps/templates/dashboard-bc.yaml b/helm/bobbycar-core-apps/templates/dashboard-bc.yaml index ef009ef..e8ec36f 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-bc.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-bc.yaml @@ -2,8 +2,8 @@ apiVersion: build.openshift.io/v1 kind: BuildConfig metadata: labels: - app: {{ .Values.dashboard.name }} - name: {{ .Values.dashboard.name }} + app: dashboard + name: dashboard namespace: {{ .Values.namespace }} spec: failedBuildsHistoryLimit: 5 diff --git a/helm/bobbycar-core-apps/templates/dashboard-configmap.yaml b/helm/bobbycar-core-apps/templates/dashboard-configmap.yaml index bdf5d37..141afe8 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-configmap.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-configmap.yaml @@ -9,8 +9,8 @@ data: "GOOGLE_API_KEY": "{{ .Values.dashboard.config.googleApiKey }}", "BOBBYCAR_API_KEY": "{{ .Values.dashboard.config.threeScaleApiKey }}", "SSE_ENDPOINT": "", - "CAR_EVENTS_ENDPOINT": "ws://{{ .Values.dashboardService.name }}-{{ .Values.namespace }}.{{ .Values.ocpDomain }}/api/carevents?sendToAll=true", - "CAR_METRICS_ENDPOINT": "ws://{{ .Values.dashboardService.name }}-{{ .Values.namespace }}.{{ .Values.ocpDomain }}/api/carmetrics?sendToAll=true", - "CAR_ZONECHANGE_ENDPOINT": "ws://{{ .Values.dashboardService.name }}-{{ .Values.namespace }}.{{ .Values.ocpDomain }}/api/zonechange?sendToAll=true", - "CACHE_ENDPOINT": "http://{{ .Values.cacheService.name }}-{{ .Values.namespace }}.{{ .Values.ocpDomain }}" + "CAR_EVENTS_ENDPOINT": "ws://dashboard-streaming-service-{{ .Values.namespace }}.{{ .Values.ocpDomain }}/api/carevents?sendToAll=true", + "CAR_METRICS_ENDPOINT": "ws://dashboard-streaming-service-{{ .Values.namespace }}.{{ .Values.ocpDomain }}/api/carmetrics?sendToAll=true", + "CAR_ZONECHANGE_ENDPOINT": "ws://dashboard-streaming-service-{{ .Values.namespace }}.{{ .Values.ocpDomain }}/api/zonechange?sendToAll=true", + "CACHE_ENDPOINT": "http://cache-service-{{ .Values.namespace }}.{{ .Values.ocpDomain }}" } diff --git a/helm/bobbycar-core-apps/templates/dashboard-dc.yaml b/helm/bobbycar-core-apps/templates/dashboard-dc.yaml index c625c0a..f2940bd 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-dc.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-dc.yaml @@ -3,14 +3,14 @@ kind: DeploymentConfig metadata: labels: app.kubernetes.io/part-of: {{ .Values.appName }} - name: {{ .Values.dashboard.name }} + name: dashboard namespace: {{ .Values.namespace }} spec: replicas: 1 revisionHistoryLimit: 10 selector: - component: {{ .Values.dashboard.name }} - deploymentconfig: {{ .Values.dashboard.name }} + component: dashboard + deploymentconfig: dashboard strategy: activeDeadlineSeconds: 21600 resources: {} @@ -24,13 +24,13 @@ spec: template: metadata: labels: - component: {{ .Values.dashboard.name }} - deploymentconfig: {{ .Values.dashboard.name }} + component: dashboard + deploymentconfig: dashboard spec: containers: - image: dashboard:latest #imagePullPolicy: Always - name: {{ .Values.dashboard.name }} + name: dashboard ports: - containerPort: 8080 protocol: TCP diff --git a/helm/bobbycar-core-apps/templates/dashboard-is.yaml b/helm/bobbycar-core-apps/templates/dashboard-is.yaml index 962378c..8fbe03f 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-is.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-is.yaml @@ -2,8 +2,8 @@ apiVersion: image.openshift.io/v1 kind: ImageStream metadata: labels: - app: {{ .Values.dashboard.name }} - name: {{ .Values.dashboard.name }} + app: dashboard + name: dashboard namespace: {{ .Values.namespace }} spec: lookupPolicy: diff --git a/helm/bobbycar-core-apps/templates/dashboard-route.yaml b/helm/bobbycar-core-apps/templates/dashboard-route.yaml index f61c451..596975d 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-route.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-route.yaml @@ -2,16 +2,16 @@ apiVersion: route.openshift.io/v1 kind: Route metadata: labels: - app: {{ .Values.dashboard.name }} - name: {{ .Values.dashboard.name }} + app: dashboard + name: dashboard namespace: {{ .Values.namespace }} spec: - host: {{ .Values.dashboard.name }}-{{ .Values.namespace }}.{{ .Values.ocpDomain }} + host: dashboard-{{ .Values.namespace }}.{{ .Values.ocpDomain }} port: targetPort: 8080-tcp to: kind: Service - name: {{ .Values.dashboard.name }} + name: dashboard weight: 100 wildcardPolicy: None status: diff --git a/helm/bobbycar-core-apps/templates/dashboard-streaming-integration.yaml b/helm/bobbycar-core-apps/templates/dashboard-streaming-integration.yaml index 93305da..2677393 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-streaming-integration.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-streaming-integration.yaml @@ -1,14 +1,14 @@ apiVersion: camel.apache.org/v1 kind: Integration metadata: - name: {{ .Values.dashboardService.name }} + name: dashboard-streaming-service labels: app.kubernetes.io/part-of: {{ .Values.appName }} spec: profile: OpenShift configuration: - type: secret - value: {{ .Values.dashboardService.name }}-secret + value: dashboard-streaming-service-secret sources: - content: {{`"package com.redhat.bobbycar.routes;\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class KafkaSseRoute extends RouteBuilder {\n\t\n\t@Override\n\tpublic void configure() throws Exception {\n\n\t\t// expose Bobbycar GPS positions from Kafka as Websocket\n\t\tfrom(\"kafka:{{com.redhat.bobbycar.camelk.kafka.topic.gps}}?clientId=kafkaSseCamelClient&brokers={{com.redhat.bobbycar.camelk.kafka.brokers}}\")\n\t\t\t.log(\"GPS position received from Kafka : ${body}\")\n\t\t\t.to(\"undertow:ws://0.0.0.0:8080/api/carevents?sendToAll=true\");\n\t\tfrom(\"undertow:ws://0.0.0.0:8080/api/carevents?sendToAll=true\")\n\t\t\t.log(\"Message received from Websocket : ${body}\");\n\n\t\t// expose Bobbycar engine metrics from Kafka as Websocket\n\t\tfrom(\"kafka:{{com.redhat.bobbycar.camelk.kafka.topic.metrics}}?clientId=kafkaSseMetricsClient&brokers={{com.redhat.bobbycar.camelk.kafka.brokers}}\")\n\t\t\t.log(\"Metric received from Kafka : ${body}\")\n\t\t\t.to(\"undertow:ws://0.0.0.0:8080/api/carmetrics?sendToAll=true\");\n\t\tfrom(\"undertow:ws://0.0.0.0:8080/api/carmetrics?sendToAll=true\")\n\t\t\t.log(\"Message received from Websocket : ${body}\");\n\n\t\t// expose Bobbycar zone change events from Kafka as Websocket\n\t\tfrom(\"kafka:{{com.redhat.bobbycar.camelk.kafka.topic.zonechange}}?clientId=kafkaSseZoneChangeClient&brokers={{com.redhat.bobbycar.camelk.kafka.brokers}}\")\n\t\t\t\t.log(\"Zone change event received from Kafka : ${body}\")\n\t\t\t\t.to(\"undertow:ws://0.0.0.0:8080/api/zonechange?sendToAll=true\");\n\t\tfrom(\"undertow:ws://0.0.0.0:8080/api/zonechange?sendToAll=true\")\n\t\t\t\t.log(\"Message received from Websocket : ${body}\");\n\t\t\n\t}\n\t\n\t\n}\n"`}} name: KafkaSseRoute.java \ No newline at end of file diff --git a/helm/bobbycar-core-apps/templates/dashboard-streaming-route.yaml b/helm/bobbycar-core-apps/templates/dashboard-streaming-route.yaml index 05d5bfe..afa6994 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-streaming-route.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-streaming-route.yaml @@ -1,14 +1,14 @@ kind: Route apiVersion: route.openshift.io/v1 metadata: - name: {{ .Values.dashboardService.name }} + name: dashboard-streaming-service labels: - camel.apache.org/integration: {{ .Values.dashboardService.name }} + camel.apache.org/integration: dashboard-streaming-service spec: - host: {{ .Values.dashboardService.name }}-{{ .Values.namespace }}.{{ .Values.ocpDomain }} + host: dashboard-streaming-service-{{ .Values.namespace }}.{{ .Values.ocpDomain }} to: kind: Service - name: {{ .Values.dashboardService.service.name }} + name: dashboard-streaming-service weight: 100 port: targetPort: http diff --git a/helm/bobbycar-core-apps/templates/dashboard-streaming-secret.yaml b/helm/bobbycar-core-apps/templates/dashboard-streaming-secret.yaml index 8a06208..2c100eb 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-streaming-secret.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-streaming-secret.yaml @@ -1,13 +1,13 @@ kind: Secret apiVersion: v1 metadata: - name: {{ .Values.dashboardService.name }}-secret + name: dashboard-streaming-service-secret stringData: application.properties: |- - com.redhat.bobbycar.camelk.kafka.brokers: {{ .Values.dashboardService.kafka.host }} - com.redhat.bobbycar.camelk.kafka.topic.gps: {{ .Values.dashboardService.kafka.topicGps }} - com.redhat.bobbycar.camelk.kafka.topic.metrics: {{ .Values.dashboardService.kafka.topicMetrics }} - com.redhat.bobbycar.camelk.kafka.topic.zonechange: {{ .Values.dashboardService.kafka.topicZoneChange }} + com.redhat.bobbycar.camelk.kafka.brokers: bobbycar-cluster-kafka-brokers:9092 + com.redhat.bobbycar.camelk.kafka.topic.gps: {{ .Values.kafka.topic.gps }} + com.redhat.bobbycar.camelk.kafka.topic.metrics: {{ .Values.kafka.topic.metrics }} + com.redhat.bobbycar.camelk.kafka.topic.zonechange: {{ .Values.kafka.topic.zonechange }} type: Opaque diff --git a/helm/bobbycar-core-apps/templates/dashboard-streaming-svc.yaml b/helm/bobbycar-core-apps/templates/dashboard-streaming-svc.yaml index fcd9454..e726f5a 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-streaming-svc.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-streaming-svc.yaml @@ -1,10 +1,10 @@ kind: Service apiVersion: v1 metadata: - name: {{ .Values.dashboardService.service.name }} + name: dashboard-streaming-service labels: camel.apache.org/generation: '1' - camel.apache.org/integration: {{ .Values.dashboardService.name }} + camel.apache.org/integration: dashboard-streaming-service camel.apache.org/service.type: user spec: ports: @@ -13,6 +13,6 @@ spec: port: 80 targetPort: http selector: - camel.apache.org/integration: {{ .Values.dashboardService.name }} + camel.apache.org/integration: dashboard-streaming-service type: ClusterIP sessionAffinity: None \ No newline at end of file diff --git a/helm/bobbycar-core-apps/templates/dashboard-svc.yaml b/helm/bobbycar-core-apps/templates/dashboard-svc.yaml index e99b0d3..b0df183 100644 --- a/helm/bobbycar-core-apps/templates/dashboard-svc.yaml +++ b/helm/bobbycar-core-apps/templates/dashboard-svc.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.dashboard.name }} + name: dashboard namespace: {{ .Values.namespace }} spec: ports: @@ -10,7 +10,7 @@ spec: protocol: TCP targetPort: 8080 selector: - component: {{ .Values.dashboard.name }} - deploymentconfig: {{ .Values.dashboard.name }} + component: dashboard + deploymentconfig: dashboard sessionAffinity: None type: ClusterIP diff --git a/helm/bobbycar-core-apps/templates/kafka2datagrid-integration.yaml b/helm/bobbycar-core-apps/templates/kafka2datagrid-integration.yaml index 90dbfeb..b1834d3 100644 --- a/helm/bobbycar-core-apps/templates/kafka2datagrid-integration.yaml +++ b/helm/bobbycar-core-apps/templates/kafka2datagrid-integration.yaml @@ -1,7 +1,7 @@ apiVersion: camel.apache.org/v1 kind: Integration metadata: - name: {{ .Values.kafka2datagrid.name }} + name: kafka2datagrid labels: app.kubernetes.io/part-of: {{ .Values.appName }} spec: diff --git a/helm/bobbycar-core-apps/templates/kafka2datagrid-secret.yaml b/helm/bobbycar-core-apps/templates/kafka2datagrid-secret.yaml index ea0b86b..97326e0 100644 --- a/helm/bobbycar-core-apps/templates/kafka2datagrid-secret.yaml +++ b/helm/bobbycar-core-apps/templates/kafka2datagrid-secret.yaml @@ -4,17 +4,17 @@ metadata: name: kafka2datagrid-secret stringData: application.properties: |- - com.redhat.bobbycar.camelk.dg.car.snapshot.cacheName: {{ .Values.kafka2datagrid.datagrid.cache.snapshot }} - com.redhat.bobbycar.camelk.dg.car.cacheName: {{ .Values.kafka2datagrid.datagrid.cache.car }} - com.redhat.bobbycar.camelk.dg.zone.cacheName: {{ .Values.kafka2datagrid.datagrid.cache.zone }} - com.redhat.bobbycar.camelk.dg.host: {{ .Values.kafka2datagrid.datagrid.account.host }} - com.redhat.bobbycar.camelk.dg.password: {{ .Values.kafka2datagrid.datagrid.account.password }} - com.redhat.bobbycar.camelk.dg.user: {{ .Values.kafka2datagrid.datagrid.account.user }} - com.redhat.bobbycar.camelk.kafka.brokers: {{ .Values.kafka2datagrid.kafka.host }} - com.redhat.bobbycar.camelk.kafka.topic: {{ .Values.kafka2datagrid.kafka.topic }} - com.redhat.bobbycar.camelk.mqtt.brokerUrl: {{ .Values.kafka2datagrid.mqtt.host }} - com.redhat.bobbycar.camelk.mqtt.topic: {{ .Values.kafka2datagrid.mqtt.topic }} - com.redhat.bobbycar.camelk.dg.ocp.api: {{ .Values.kafka2datagrid.ocp.api }} + com.redhat.bobbycar.camelk.dg.car.snapshot.cacheName: {{ .Values.datagrid.cache.snapshot }} + com.redhat.bobbycar.camelk.dg.car.cacheName: {{ .Values.datagrid.cache.car }} + com.redhat.bobbycar.camelk.dg.zone.cacheName: {{ .Values.datagrid.cache.zone }} + com.redhat.bobbycar.camelk.dg.host: bobbycar-dg + com.redhat.bobbycar.camelk.dg.password: {{ .Values.datagrid.account.password }} + com.redhat.bobbycar.camelk.dg.user: {{ .Values.datagrid.account.user }} + com.redhat.bobbycar.camelk.kafka.brokers: bobbycar-cluster-kafka-brokers:9092 + com.redhat.bobbycar.camelk.kafka.topic: {{ .Values.kafka.topic.gps }} + com.redhat.bobbycar.camelk.mqtt.brokerUrl: tcp://bobbycar-amq-mqtt-all-0-svc:61616 + com.redhat.bobbycar.camelk.mqtt.topic: {{ .Values.mqtt.topic.mqttZoneChangeTopic }} + com.redhat.bobbycar.camelk.dg.ocp.api: {{ .Values.ocpApi }} com.redhat.bobbycar.camelk.dg.namespace: {{ .Values.namespace }} type: Opaque diff --git a/helm/bobbycar-core-apps/templates/mqtt2kafka-integration.yaml b/helm/bobbycar-core-apps/templates/mqtt2kafka-integration.yaml index 9a784f3..4b3ecd9 100644 --- a/helm/bobbycar-core-apps/templates/mqtt2kafka-integration.yaml +++ b/helm/bobbycar-core-apps/templates/mqtt2kafka-integration.yaml @@ -1,11 +1,11 @@ apiVersion: camel.apache.org/v1 kind: Integration metadata: - name: {{ .Values.mqtt2kafka.name }} + name: mqtt2kafka spec: configuration: - type: secret - value: {{ .Values.mqtt2kafka.name }}-secret + value: mqtt2kafka-secret profile: OpenShift sources: - content: {{`"package com.redhat.bobbycar.routes;\n\nimport java.nio.charset.Charset;\nimport java.util.stream.Collectors;\n\nimport org.apache.camel.PropertyInject;\nimport org.apache.camel.builder.RouteBuilder;\n\npublic class MqttToKafka extends RouteBuilder {\n\t\n\t@Override\n\tpublic void configure() throws Exception {\n\n\t\tfrom(\"paho:{{com.redhat.bobbycar.camelk.mqtt.topic}}?brokerUrl={{com.redhat.bobbycar.camelk.mqtt.brokerUrl}}\")\n\t\t\t.log(\"Publishing engine metric ${body} to Kafka\")\n\t\t.to(\"kafka:{{com.redhat.bobbycar.camelk.kafka.topic}}?clientId=mqtt2kafkaClientEM&brokers={{com.redhat.bobbycar.camelk.kafka.brokers}}\");\n\n\t\tfrom(\"paho:{{com.redhat.bobbycar.camelk.mqtt.topicZoneChange}}?brokerUrl={{com.redhat.bobbycar.camelk.mqtt.brokerUrl}}\")\n\t\t\t.log(\"Publishing zone change ${body} to Kafka\")\n\t\t.to(\"kafka:{{com.redhat.bobbycar.camelk.kafka.topicZoneChange}}?clientId=mqtt2kafkaClientZC&brokers={{com.redhat.bobbycar.camelk.kafka.brokers}}\");\n\t\n\t}\t\n\t\n}\n"`}} diff --git a/helm/bobbycar-core-apps/templates/mqtt2kafka-secret.yaml b/helm/bobbycar-core-apps/templates/mqtt2kafka-secret.yaml index 2853507..fddcc76 100644 --- a/helm/bobbycar-core-apps/templates/mqtt2kafka-secret.yaml +++ b/helm/bobbycar-core-apps/templates/mqtt2kafka-secret.yaml @@ -1,15 +1,15 @@ kind: Secret apiVersion: v1 metadata: - name: {{ .Values.mqtt2kafka.name }}-secret + name: mqtt2kafka-secret stringData: application.properties: |- - com.redhat.bobbycar.camelk.kafka.brokers: {{ .Values.mqtt2kafka.kafka.host }} - com.redhat.bobbycar.camelk.kafka.topic: {{ .Values.mqtt2kafka.kafka.topic }} - com.redhat.bobbycar.camelk.kafka.topicZoneChange: {{ .Values.mqtt2kafka.kafka.topicZoneChange }} - com.redhat.bobbycar.camelk.mqtt.brokerUrl: {{ .Values.mqtt2kafka.mqtt.host }} - com.redhat.bobbycar.camelk.mqtt.topic: {{ .Values.mqtt2kafka.mqtt.topic }} - com.redhat.bobbycar.camelk.mqtt.topicZoneChange: {{ .Values.mqtt2kafka.mqtt.topicZoneChange }} + com.redhat.bobbycar.camelk.kafka.brokers: bobbycar-cluster-kafka-brokers:9092 + com.redhat.bobbycar.camelk.kafka.topic: {{ .Values.kafka.topic.metrics }} + com.redhat.bobbycar.camelk.kafka.topicZoneChange: {{ .Values.kafka.topic.zonechange }} + com.redhat.bobbycar.camelk.mqtt.brokerUrl: tcp://bobbycar-amq-mqtt-all-0-svc:61616 + com.redhat.bobbycar.camelk.mqtt.topic: {{ .Values.mqtt.topic.mqttMetricsTopic }} + com.redhat.bobbycar.camelk.mqtt.topicZoneChange: {{ .Values.mqtt.topic.mqttZoneChangeTopic }} type: Opaque diff --git a/helm/bobbycar-core-apps/values.yaml b/helm/bobbycar-core-apps/values.yaml index f6733e9..229a7df 100644 --- a/helm/bobbycar-core-apps/values.yaml +++ b/helm/bobbycar-core-apps/values.yaml @@ -2,14 +2,34 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -namespace: bobbycar +namespace: bc appName: Bobbycar -ocpDomain: apps.ocp3.stormshift.coe.muc.redhat.com +ocpDomain: apps.ocp4.stormshift.coe.muc.redhat.com +ocpApi: api.ocp4.stormshift.coe.muc.redhat.com + +mqtt: + topic: + mqttZoneChangeTopic: bobbycar/zonechange + mqttMetricsTopic: bobbycar/enginemetrics + +kafka: + topic: + gps: bobbycar-gps + metrics: bobbycar-metrics + zonechange: bobbycar-zonechange + +datagrid: + cache: + snapshot: carsnapshots + car: cars + zone: zones + account: + user: operator + password: EohPRcN95Bjc8Rr7 dashboard: - name: dashboard config: - googleApiKey: replaceme + googleApiKey: AIzaSyCH6fNIRY-3VeZ7eR3X1fu5UBCs5Ip-mbE threeScaleApiKey: replaceme carSimulator: @@ -19,53 +39,4 @@ carSimulator: carsimCars: 20 carsimFactor: 3 carsimRepeat: true - carsimDelay: 1000 - mqttZoneChangeTopic: bobbycar/zonechange - mqttMetricsTopic: bobbycar/enginemetrics - mqttHost: bobbycar-amq-mqtt-all-0-svc - mqttPort: 61616 - kafkaBridgeServiceUrl: bobbycar-oschneid-bc.apps.ocp3.stormshift.coe.muc.redhat.com - -dashboardService: - name: dashboard-streaming-service - kafka: - host: bobbycar-cluster-kafka-brokers:9092 - topicGps: bobbycar-gps - topicMetrics: bobbycar-metrics - topicZoneChange: bobbycar-zonechange - service: - name: dashboard-streaming-service - -cacheService: - name: cache-service - -mqtt2kafka: - name: mqtt2kafka - kafka: - host: bobbycar-cluster-kafka-brokers:9092 - topic: bobbycar-metrics - topicZoneChange: bobbycar-zonechange - mqtt: - host: tcp://bobbycar-amq-mqtt-all-0-svc:61616 - topic: bobbycar/enginemetrics - topicZoneChange: bobbycar/zonechange - -kafka2datagrid: - name: kafka-to-datagrid - datagrid: - cache: - snapshot: carsnapshots - car: cars - zone: zones - account: - host: bobbycar-dg - user: operator - password: cRpOMlpv6iyqlaFm - kafka: - host: bobbycar-cluster-kafka-brokers:9092 - topic: bobbycar-gps - mqtt: - host: tcp://bobbycar-amq-mqtt-all-0-svc:61616 - topic: bobbycar/zonechange - ocp: - api: api.ocp3.stormshift.coe.muc.redhat.com \ No newline at end of file + carsimDelay: 1000 \ No newline at end of file