Add complex application

This commit is contained in:
Thomas Philipona 2021-03-30 09:46:02 +02:00
parent 4776de345f
commit 6c8e6ca4f6
No known key found for this signature in database
GPG Key ID: 91413DA18EA2CFBC
8 changed files with 261 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,4 @@
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: jaeger-all-in-one-inmemory

View File

@ -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: {}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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