diff --git a/complex-application/consumer.yaml b/complex-application/consumer.yaml new file mode 100644 index 0000000..1596976 --- /dev/null +++ b/complex-application/consumer.yaml @@ -0,0 +1,90 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: data-consumer + application: amm-techlab + name: data-consumer +spec: + replicas: 1 + selector: + matchLabels: + deployment: data-consumer + strategy: + type: Recreate + template: + metadata: + labels: + deployment: data-consumer + app: data-consumer + application: amm-techlab + spec: + containers: + - image: quay.io/puzzle/quarkus-techlab-data-consumer:jaegerkafka + imagePullPolicy: Always + livenessProbe: + failureThreshold: 5 + httpGet: + path: /health + port: 8080 + scheme: HTTP + initialDelaySeconds: 3 + periodSeconds: 20 + successThreshold: 1 + timeoutSeconds: 15 + readinessProbe: + failureThreshold: 5 + httpGet: + path: /health + port: 8080 + scheme: HTTP + initialDelaySeconds: 3 + periodSeconds: 20 + successThreshold: 1 + timeoutSeconds: 15 + name: data-consumer + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + limits: + cpu: '1' + memory: 500Mi + requests: + cpu: 50m + memory: 100Mi +--- +apiVersion: v1 +kind: Service +metadata: + labels: + application: amm-techlab + app: data-consumer + name: data-consumer +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + deployment: data-consumer + sessionAffinity: None + type: ClusterIP +--- +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + labels: + application: amm-techlab + app: data-consumer + name: data-consumer +spec: + path: / + tls: + insecureEdgeTerminationPolicy: Allow + termination: edge + to: + kind: Service + name: data-consumer diff --git a/complex-application/consumerConfigMap.yaml b/complex-application/consumerConfigMap.yaml new file mode 100644 index 0000000..8c3a534 --- /dev/null +++ b/complex-application/consumerConfigMap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: consumer-config +data: + # Configure the SmallRye Kafka connector + kafka.bootstrap.servers: 'amm-techlab-kafka-bootstrap:9092' + + #Toggle jaeger trace feature + consumer.jaeger.enabled: 'true' + + # Configure the Kafka sink + mp.messaging.incoming.data.connector: smallrye-kafka + mp.messaging.incoming.data.topic: manual + mp.messaging.incoming.data.value.deserializer: ch.puzzle.quarkustechlab.reactiveconsumer.control.SensorMeasurementDeserializer diff --git a/complex-application/jaeger.yaml b/complex-application/jaeger.yaml new file mode 100644 index 0000000..4f9a47a --- /dev/null +++ b/complex-application/jaeger.yaml @@ -0,0 +1,4 @@ +apiVersion: jaegertracing.io/v1 +kind: Jaeger +metadata: + name: jaeger-all-in-one-inmemory diff --git a/complex-application/kafka-cluster.yaml b/complex-application/kafka-cluster.yaml new file mode 100644 index 0000000..105acf7 --- /dev/null +++ b/complex-application/kafka-cluster.yaml @@ -0,0 +1,49 @@ +apiVersion: kafka.strimzi.io/v1beta1 +kind: Kafka +metadata: + name: amm-techlab + labels: + application: amm-techlab +spec: + kafka: + version: 2.6.0 + replicas: 1 + listeners: + plain: {} + tls: {} + config: + auto.create.topics.enable: false + offsets.topic.replication.factor: 1 + transaction.state.log.replication.factor: 1 + transaction.state.log.min.isr: 1 + log.message.format.version: "2.6" + resources: + requests: + memory: 128Mi + cpu: "50m" + limits: + memory: 4Gi + cpu: "2" + storage: + type: jbod + volumes: + - id: 0 + type: persistent-claim + size: 10Gi + deleteClaim: false + zookeeper: + replicas: 1 + resources: + requests: + memory: 128Mi + cpu: "50m" + limits: + memory: 4Gi + cpu: "2" + storage: + type: persistent-claim + size: 10Gi + deleteClaim: false + entityOperator: + topicOperator: {} + userOperator: {} diff --git a/complex-application/manual-topic.yaml b/complex-application/manual-topic.yaml new file mode 100644 index 0000000..75d7e52 --- /dev/null +++ b/complex-application/manual-topic.yaml @@ -0,0 +1,13 @@ +apiVersion: kafka.strimzi.io/v1beta1 +kind: KafkaTopic +metadata: + name: manual + labels: + application: amm-techlab + strimzi.io/cluster: amm-techlab +spec: + partitions: 1 + replicas: 1 + config: + retention.ms: 7200000 + segment.bytes: 1073741824 diff --git a/complex-application/producer.yaml b/complex-application/producer.yaml new file mode 100644 index 0000000..061c941 --- /dev/null +++ b/complex-application/producer.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: data-producer + application: amm-techlab + name: data-producer +spec: + replicas: 1 + selector: + matchLabels: + deployment: data-producer + strategy: + type: Recreate + template: + metadata: + labels: + application: amm-techlab + deployment: data-producer + app: data-producer + spec: + containers: + - image: quay.io/puzzle/quarkus-techlab-data-producer:jaegerkafka + imagePullPolicy: Always + env: + - name: PRODUCER_JAEGER_ENABLED + value: 'true' + livenessProbe: + failureThreshold: 5 + httpGet: + path: /health/live + port: 8080 + scheme: HTTP + initialDelaySeconds: 3 + periodSeconds: 20 + timeoutSeconds: 15 + readinessProbe: + failureThreshold: 5 + httpGet: + path: /health/ready + port: 8080 + scheme: HTTP + initialDelaySeconds: 3 + periodSeconds: 20 + timeoutSeconds: 15 + name: data-producer + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + limits: + cpu: '1' + memory: 500Mi + requests: + cpu: 50m + memory: 100Mi diff --git a/complex-application/route.yaml b/complex-application/route.yaml new file mode 100644 index 0000000..fe7470b --- /dev/null +++ b/complex-application/route.yaml @@ -0,0 +1,16 @@ +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + labels: + application: amm-techlab + name: data-producer +spec: + port: + targetPort: http + to: + kind: Service + name: data-producer + weight: 100 + tls: + termination: edge + wildcardPolicy: None diff --git a/complex-application/svc.yaml b/complex-application/svc.yaml new file mode 100644 index 0000000..1e1ea5c --- /dev/null +++ b/complex-application/svc.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: data-producer + labels: + application: amm-techlab +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: http + selector: + app: data-producer + deployment: data-producer + sessionAffinity: None + type: ClusterIP