Skip to content
Snippets Groups Projects
Commit 209375ab authored by Björn Vonheiden's avatar Björn Vonheiden
Browse files

Structure use case infrastructe better with kustomize

Reorder the structure of the use cases to use a base and customize
this accordingly to their needs.
parent b5c80e48
No related branches found
No related tags found
3 merge requests!42Integerate theodolite and run uc python scripts,!24run UC as python implementation,!19Replace Kubernetes YAML sed-replacements by Kustomize
Showing
with 95 additions and 119 deletions
...@@ -42,15 +42,15 @@ spec: ...@@ -42,15 +42,15 @@ spec:
- name: workload-generator - name: workload-generator
env: env:
- name: NUM_SENSORS - name: NUM_SENSORS
value: $NUM_SENSORS value: "$NUM_SENSORS"
- name: INSTANCES - name: INSTANCES
value: $WL_INSTANCES value: "$WL_INSTANCES"
EOF EOF
kubectl apply -k uc1-workload-generator kubectl apply -k uc1-workload-generator
# Start application # Start application
REPLICAS=$INSTANCES REPLICAS=$INSTANCES
cat <<EOF >uc1-application/set_paramters.yaml cat <<EOF >uc-application/overlay/uc1-application/set_paramters.yaml
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -59,17 +59,17 @@ spec: ...@@ -59,17 +59,17 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: uc1-application - name: uc-application
env: env:
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: $KAFKA_STREAMS_COMMIT_INTERVAL_MS value: "$KAFKA_STREAMS_COMMIT_INTERVAL_MS"
resources: resources:
limits: limits:
memory: $MEMORY_LIMIT memory: $MEMORY_LIMIT
cpu: $CPU_LIMIT cpu: $CPU_LIMIT
EOF EOF
kubectl apply -k uc1-application kubectl apply -k uc-application/overlay/uc1-application
kubectl scale deployment titan-ccp-aggregation --replicas=$REPLICAS kubectl scale deployment uc1-titan-ccp-aggregation --replicas=$REPLICAS
# Execute for certain time # Execute for certain time
sleep ${EXECUTION_MINUTES}m sleep ${EXECUTION_MINUTES}m
...@@ -81,7 +81,7 @@ deactivate ...@@ -81,7 +81,7 @@ deactivate
# Stop workload generator and app # Stop workload generator and app
kubectl delete -k uc1-workload-generator kubectl delete -k uc1-workload-generator
kubectl delete -k uc1-application kubectl delete -k uc-application/overlay/uc1-application
# Delete topics instead of Kafka # Delete topics instead of Kafka
......
...@@ -45,8 +45,7 @@ kubectl apply -k uc2-workload-generator ...@@ -45,8 +45,7 @@ kubectl apply -k uc2-workload-generator
# Start application # Start application
REPLICAS=$INSTANCES REPLICAS=$INSTANCES
# When not using `sed` anymore, use `kubectl apply -f uc2-application` cat <<EOF >uc-application/overlay/uc1-application/set_paramters.yaml
cat <<EOF >uc2-application/set_paramters.yaml
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -55,17 +54,17 @@ spec: ...@@ -55,17 +54,17 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: uc1-application - name: uc-application
env: env:
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: $KAFKA_STREAMS_COMMIT_INTERVAL_MS value: "$KAFKA_STREAMS_COMMIT_INTERVAL_MS"
resources: resources:
limits: limits:
memory: $MEMORY_LIMIT memory: $MEMORY_LIMIT
cpu: $CPU_LIMIT cpu: $CPU_LIMIT
EOF EOF
kubectl apply -k uc2-application kubectl apply -k uc-application/overlay/uc2-application
kubectl scale deployment titan-ccp-aggregation --replicas=$REPLICAS kubectl scale deployment uc2-titan-ccp-aggregation --replicas=$REPLICAS
# Execute for certain time # Execute for certain time
sleep ${EXECUTION_MINUTES}m sleep ${EXECUTION_MINUTES}m
...@@ -77,7 +76,7 @@ deactivate ...@@ -77,7 +76,7 @@ deactivate
# Stop workload generator and app # Stop workload generator and app
kubectl delete -k uc2-workload-generator kubectl delete -k uc2-workload-generator
kubectl delete -k uc2-application kubectl delete -k uc-application/overlay/uc2-application
# Delete topics instead of Kafka # Delete topics instead of Kafka
......
...@@ -51,7 +51,7 @@ kubectl apply -k uc3-workload-generator ...@@ -51,7 +51,7 @@ kubectl apply -k uc3-workload-generator
# Start application # Start application
REPLICAS=$INSTANCES REPLICAS=$INSTANCES
cat <<EOF >uc3-application/set_paramters.yaml cat <<EOF >uc-application/overlay/uc3-application/set_paramters.yaml
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -60,17 +60,17 @@ spec: ...@@ -60,17 +60,17 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: uc1-application - name: uc-application
env: env:
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: $KAFKA_STREAMS_COMMIT_INTERVAL_MS value: "$KAFKA_STREAMS_COMMIT_INTERVAL_MS"
resources: resources:
limits: limits:
memory: $MEMORY_LIMIT memory: $MEMORY_LIMIT
cpu: $CPU_LIMIT cpu: $CPU_LIMIT
EOF EOF
kubectl apply -k uc3-application kubectl apply -k uc-application/overlay/uc3-application
kubectl scale deployment titan-ccp-aggregation --replicas=$REPLICAS kubectl scale deployment uc3-titan-ccp-aggregation --replicas=$REPLICAS
# Execute for certain time # Execute for certain time
sleep ${EXECUTION_MINUTES}m sleep ${EXECUTION_MINUTES}m
...@@ -82,7 +82,7 @@ deactivate ...@@ -82,7 +82,7 @@ deactivate
# Stop workload generator and app # Stop workload generator and app
kubectl delete -k uc1-workload-generator kubectl delete -k uc1-workload-generator
kubectl delete -k uc1-application kubectl delete -k uc-application/overlay/uc3-application
# Delete topics instead of Kafka # Delete topics instead of Kafka
#kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --delete --topic 'input,output,configuration,titan-.*'" #kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --delete --topic 'input,output,configuration,titan-.*'"
......
...@@ -45,7 +45,7 @@ kubectl apply -k uc4-workload-generator ...@@ -45,7 +45,7 @@ kubectl apply -k uc4-workload-generator
# Start application # Start application
REPLICAS=$INSTANCES REPLICAS=$INSTANCES
cat <<EOF >uc1-application/set_paramters.yaml cat <<EOF >uc-application/overlay/uc1-application/set_paramters.yaml
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -54,17 +54,17 @@ spec: ...@@ -54,17 +54,17 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: uc1-application - name: uc-application
env: env:
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: $KAFKA_STREAMS_COMMIT_INTERVAL_MS value: "$KAFKA_STREAMS_COMMIT_INTERVAL_MS"
resources: resources:
limits: limits:
memory: $MEMORY_LIMIT memory: $MEMORY_LIMIT
cpu: $CPU_LIMIT cpu: $CPU_LIMIT
EOF EOF
kubectl apply -k uc4-application kubectl apply -k uc-application/overlay/uc4-application
kubectl scale deployment titan-ccp-aggregation --replicas=$REPLICAS kubectl scale deployment uc4-titan-ccp-aggregation --replicas=$REPLICAS
# Execute for certain time # Execute for certain time
sleep ${EXECUTION_MINUTES}m sleep ${EXECUTION_MINUTES}m
...@@ -76,7 +76,7 @@ deactivate ...@@ -76,7 +76,7 @@ deactivate
# Stop workload generator and app # Stop workload generator and app
kubectl delete -k uc4-workload-generator kubectl delete -k uc4-workload-generator
kubectl delete -k uc4-application kubectl delete -k uc-application/overlay/uc4-application
# Delete topics instead of Kafka # Delete topics instead of Kafka
......
...@@ -14,8 +14,8 @@ spec: ...@@ -14,8 +14,8 @@ spec:
spec: spec:
terminationGracePeriodSeconds: 0 terminationGracePeriodSeconds: 0
containers: containers:
- name: uc1-application - name: uc-application
image: "soerenhenning/uc1-app:latest" image: "uc-app:latest"
ports: ports:
- containerPort: 5555 - containerPort: 5555
name: jmx name: jmx
......
...@@ -10,6 +10,3 @@ resources: ...@@ -10,6 +10,3 @@ resources:
- aggregation-service.yaml - aggregation-service.yaml
- service-monitor.yaml - service-monitor.yaml
- jmx-configmap.yaml - jmx-configmap.yaml
patchesStrategicMerge:
- set_paramters.yaml # Patch setting the resource parameters
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
commonLabels: namePrefix: uc1-
app: titan-ccp-aggregation
images:
# Use all resources to compose them into one file - name: uc-app
resources: newName: soerenhenning/uc1-app
- aggregation-deployment.yaml newTag: latest
- aggregation-service.yaml
- service-monitor.yaml bases:
- jmx-configmap.yaml - ../../base
patchesStrategicMerge: patchesStrategicMerge:
- set_paramters.yaml # Patch setting the resource parameters - set_paramters.yaml # Patch setting the resource parameters
...@@ -6,10 +6,10 @@ spec: ...@@ -6,10 +6,10 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: uc2-application - name: uc-application
env: env:
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: 100 value: "100"
resources: resources:
limits: limits:
memory: 4Gi memory: 4Gi
......
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
commonLabels: namePrefix: uc2-
app: titan-ccp-aggregation
images:
# Use all resources to compose them into one file - name: uc-app
resources: newName: soerenhenning/uc2-app
- aggregation-deployment.yaml newTag: latest
- aggregation-service.yaml
- service-monitor.yaml bases:
- jmx-configmap.yaml - ../../base
patchesStrategicMerge: patchesStrategicMerge:
- set_paramters.yaml # Patch setting the resource parameters - set_paramters.yaml # Patch setting the resource parameters
...@@ -6,10 +6,10 @@ spec: ...@@ -6,10 +6,10 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: uc1-application - name: uc-application
env: env:
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: 100 value: "100"
resources: resources:
limits: limits:
memory: 4Gi memory: 4Gi
......
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
commonLabels: namePrefix: uc3-
app: titan-ccp-aggregation
images:
# Use all resources to compose them into one file - name: uc-app
resources: newName: soerenhenning/uc3-app
- aggregation-deployment.yaml newTag: latest
- aggregation-service.yaml
- service-monitor.yaml bases:
- jmx-configmap.yaml - ../../base
patchesStrategicMerge: patchesStrategicMerge:
- set_paramters.yaml # Patch setting the resource parameters - set_paramters.yaml # Patch setting the resource parameters
...@@ -6,7 +6,7 @@ spec: ...@@ -6,7 +6,7 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: uc3-application - name: uc-application
env: env:
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: 100 value: 100
......
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namePrefix: uc4-
images:
- name: uc-app
newName: soerenhenning/uc4-app
newTag: latest
bases:
- ../../base
patchesStrategicMerge:
- set_paramters.yaml # Patch setting the resource parameters
...@@ -6,10 +6,10 @@ spec: ...@@ -6,10 +6,10 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: uc4-application - name: uc-application
env: env:
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: 100 value: "100"
resources: resources:
limits: limits:
memory: 4Gi memory: 4Gi
......
apiVersion: apps/v1
kind: Deployment
metadata:
name: titan-ccp-aggregation
spec:
selector:
matchLabels:
app: titan-ccp-aggregation
replicas: 1
template:
metadata:
labels:
app: titan-ccp-aggregation
spec:
terminationGracePeriodSeconds: 0
containers:
- name: uc2-application
image: "benediktwetzel/uc2-app:latest"
ports:
- containerPort: 5555
name: jmx
env:
- name: KAFKA_BOOTSTRAP_SERVERS
value: "my-confluent-cp-kafka:9092"
- name: COMMIT_INTERVAL_MS
value: 100
- name: JAVA_OPTS
value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555"
resources:
limits:
memory: 4Gi
cpu: 1000m
- name: prometheus-jmx-exporter
image: "solsson/kafka-prometheus-jmx-exporter@sha256:6f82e2b0464f50da8104acd7363fb9b995001ddff77d248379f8788e78946143"
command:
- java
- -XX:+UnlockExperimentalVMOptions
- -XX:+UseCGroupMemoryLimitForHeap
- -XX:MaxRAMFraction=1
- -XshowSettings:vm
- -jar
- jmx_prometheus_httpserver.jar
- "5556"
- /etc/jmx-aggregation/jmx-kafka-prometheus.yml
ports:
- containerPort: 5556
volumeMounts:
- name: jmx-config
mountPath: /etc/jmx-aggregation
volumes:
- name: jmx-config
configMap:
name: aggregation-jmx-configmap
apiVersion: v1
kind: Service
metadata:
name: titan-ccp-aggregation
labels:
app: titan-ccp-aggregation
spec:
#type: NodePort
selector:
app: titan-ccp-aggregation
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP
- name: metrics
port: 5556
apiVersion: v1
kind: ConfigMap
metadata:
name: aggregation-jmx-configmap
data:
jmx-kafka-prometheus.yml: |+
jmxUrl: service:jmx:rmi:///jndi/rmi://localhost:5555/jmxrmi
lowercaseOutputName: true
lowercaseOutputLabelNames: true
ssl: false
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment