From 66db61aad553988e4aa2a3f6ec5583b239d789bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@jku.at>
Date: Thu, 24 Aug 2023 13:23:23 +0200
Subject: [PATCH] Replace wildcard kafkaConfigs with delete actions

---
 .../uc1-beam-samza-benchmark-operator.yaml    | 17 +++++++------
 .../uc2-beam-flink-benchmark-operator.yaml    |  5 ----
 .../uc2-beam-samza-benchmark-operator.yaml    | 17 +++++++------
 .../uc2-flink-benchmark-operator.yaml         |  5 ----
 .../uc2-hazelcastjet-benchmark-operator.yaml  |  5 ----
 .../uc2-kstreams-benchmark-operator.yaml      | 17 +++++--------
 .../uc3-beam-flink-benchmark-operator.yaml    |  5 ----
 .../uc3-beam-samza-benchmark-operator.yaml    | 17 +++++++------
 .../uc3-flink-benchmark-operator.yaml         |  5 ----
 .../uc3-hazelcastjet-benchmark-operator.yaml  |  5 ----
 .../uc3-kstreams-benchmark-operator.yaml      | 11 +++++----
 .../uc4-beam-flink-benchmark-operator.yaml    |  5 ----
 .../uc4-beam-samza-benchmark-operator.yaml    | 24 ++++++++++++-------
 .../uc4-flink-benchmark-operator.yaml         |  5 ----
 .../uc4-hazelcastjet-benchmark-operator.yaml  |  5 ----
 .../uc4-kstreams-benchmark-operator.yaml      | 11 +++++----
 16 files changed, 63 insertions(+), 96 deletions(-)

diff --git a/theodolite-benchmarks/definitions/uc1-beam-samza/uc1-beam-samza-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc1-beam-samza/uc1-beam-samza-benchmark-operator.yaml
index ff81feaac..a98cca9b1 100644
--- a/theodolite-benchmarks/definitions/uc1-beam-samza/uc1-beam-samza-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc1-beam-samza/uc1-beam-samza-benchmark-operator.yaml
@@ -26,6 +26,16 @@ spec:
             container: "zookeeper-client"
           command: ["bash", "-c", "bin/zkCli.sh -server $ZOOKEEPER_SERVER deleteall /app-theodolite-uc1-application-1"]
           timeoutSeconds: 60
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: ".*samza.*"
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: ".*uc1-application.*"
   loadGenerator:
     resources:
       - configMap:
@@ -81,10 +91,3 @@ spec:
         threshold: 2000
         externalSloUrl: "http://localhost:80/evaluate-slope"
         warmup: 60 # in seconds
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: ".*samza.*"
-        removeOnly: true
-      - name: ".*uc1-application.*"
-        removeOnly: true
\ No newline at end of file
diff --git a/theodolite-benchmarks/definitions/uc2-beam-flink/uc2-beam-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-beam-flink/uc2-beam-flink-benchmark-operator.yaml
index a55b9df05..1b8597a92 100644
--- a/theodolite-benchmarks/definitions/uc2-beam-flink/uc2-beam-flink-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc2-beam-flink/uc2-beam-flink-benchmark-operator.yaml
@@ -105,8 +105,3 @@ spec:
         repetitionAggregation: median
         operator: lte
         threshold: 100
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc2-beam-samza/uc2-beam-samza-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-beam-samza/uc2-beam-samza-benchmark-operator.yaml
index 6e92cb3f1..baf2775d0 100644
--- a/theodolite-benchmarks/definitions/uc2-beam-samza/uc2-beam-samza-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc2-beam-samza/uc2-beam-samza-benchmark-operator.yaml
@@ -27,6 +27,16 @@ spec:
             container: "zookeeper-client"
           command: ["bash", "-c", "bin/zkCli.sh -server $ZOOKEEPER_SERVER deleteall /app-theodolite-uc2-application-1"]
           timeoutSeconds: 60
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: ".*samza.*"
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: ".*uc2-application.*"
   loadGenerator:
     resources:
       - configMap:
@@ -82,10 +92,3 @@ spec:
         threshold: 2000
         externalSloUrl: "http://localhost:80/evaluate-slope"
         warmup: 60 # in seconds
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: ".*samza.*"
-        removeOnly: true
-      - name: ".*uc2-application.*"
-        removeOnly: true
\ No newline at end of file
diff --git a/theodolite-benchmarks/definitions/uc2-flink/uc2-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-flink/uc2-flink-benchmark-operator.yaml
index e3b27eb55..85792aa12 100644
--- a/theodolite-benchmarks/definitions/uc2-flink/uc2-flink-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc2-flink/uc2-flink-benchmark-operator.yaml
@@ -105,8 +105,3 @@ spec:
         repetitionAggregation: median
         operator: lte
         threshold: 100
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc2-hazelcastjet/uc2-hazelcastjet-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-hazelcastjet/uc2-hazelcastjet-benchmark-operator.yaml
index 3f2412d8a..bae58e3d0 100644
--- a/theodolite-benchmarks/definitions/uc2-hazelcastjet/uc2-hazelcastjet-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc2-hazelcastjet/uc2-hazelcastjet-benchmark-operator.yaml
@@ -80,8 +80,3 @@ spec:
         repetitionAggregation: median
         operator: lte
         threshold: 100
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc2-kstreams/uc2-kstreams-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-kstreams/uc2-kstreams-benchmark-operator.yaml
index 73f4297cd..c34cd7e54 100644
--- a/theodolite-benchmarks/definitions/uc2-kstreams/uc2-kstreams-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc2-kstreams/uc2-kstreams-benchmark-operator.yaml
@@ -18,6 +18,12 @@ spec:
             - "uc2-kstreams-service.yaml"
             - "uc2-jmx-configmap.yaml"
             - "uc2-service-monitor.yaml"
+    afterActions:
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: "^theodolite-.*"
   loadGenerator:
     resources:
       - configMap:
@@ -85,14 +91,3 @@ spec:
         repetitionAggregation: median
         operator: lte
         threshold: 100
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      # - name: "input"
-      #   numPartitions: 100
-      #   replicationFactor: 1
-      # - name: "output"
-      #   numPartitions: 100
-      #   replicationFactor: 1
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc3-beam-flink/uc3-beam-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-beam-flink/uc3-beam-flink-benchmark-operator.yaml
index 64a286d1b..6e712e7d3 100644
--- a/theodolite-benchmarks/definitions/uc3-beam-flink/uc3-beam-flink-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc3-beam-flink/uc3-beam-flink-benchmark-operator.yaml
@@ -100,8 +100,3 @@ spec:
         threshold: 2000
         externalSloUrl: "http://localhost:80/evaluate-slope"
         warmup: 60 # in seconds
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc3-beam-samza/uc3-beam-samza-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-beam-samza/uc3-beam-samza-benchmark-operator.yaml
index e800b5d19..2d2096806 100644
--- a/theodolite-benchmarks/definitions/uc3-beam-samza/uc3-beam-samza-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc3-beam-samza/uc3-beam-samza-benchmark-operator.yaml
@@ -27,6 +27,16 @@ spec:
             container: "zookeeper-client"
           command: ["bash", "-c", "bin/zkCli.sh -server $ZOOKEEPER_SERVER deleteall /app-theodolite-uc3-application-1"]
           timeoutSeconds: 60
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: ".*samza.*"
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: ".*uc3-application.*"
   loadGenerator:
     resources:
       - configMap:
@@ -89,10 +99,3 @@ spec:
         threshold: 2000
         externalSloUrl: "http://localhost:80/evaluate-slope"
         warmup: 60 # in seconds
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: ".*samza.*"
-        removeOnly: true
-      - name: ".*uc3-application.*"
-        removeOnly: true
\ No newline at end of file
diff --git a/theodolite-benchmarks/definitions/uc3-flink/uc3-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-flink/uc3-flink-benchmark-operator.yaml
index d5717734f..a7139477f 100644
--- a/theodolite-benchmarks/definitions/uc3-flink/uc3-flink-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc3-flink/uc3-flink-benchmark-operator.yaml
@@ -100,8 +100,3 @@ spec:
         threshold: 2000
         externalSloUrl: "http://localhost:80/evaluate-slope"
         warmup: 60 # in seconds
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc3-hazelcastjet/uc3-hazelcastjet-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-hazelcastjet/uc3-hazelcastjet-benchmark-operator.yaml
index 62086b68a..cf9c5b565 100644
--- a/theodolite-benchmarks/definitions/uc3-hazelcastjet/uc3-hazelcastjet-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc3-hazelcastjet/uc3-hazelcastjet-benchmark-operator.yaml
@@ -75,8 +75,3 @@ spec:
         threshold: 2000
         externalSloUrl: "http://localhost:80/evaluate-slope"
         warmup: 60 # in seconds
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc3-kstreams/uc3-kstreams-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-kstreams/uc3-kstreams-benchmark-operator.yaml
index 6917380a2..91a34ace5 100644
--- a/theodolite-benchmarks/definitions/uc3-kstreams/uc3-kstreams-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc3-kstreams/uc3-kstreams-benchmark-operator.yaml
@@ -18,6 +18,12 @@ spec:
           - "uc3-kstreams-service.yaml"
           - "uc3-jmx-configmap.yaml"
           - "uc3-service-monitor.yaml"
+    afterActions:
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: "^theodolite-.*"
   loadGenerator:
     resources:
       - configMap:
@@ -80,8 +86,3 @@ spec:
         threshold: 2000
         externalSloUrl: "http://localhost:80/evaluate-slope"
         warmup: 60 # in seconds
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc4-beam-flink/uc4-beam-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-beam-flink/uc4-beam-flink-benchmark-operator.yaml
index b7f931457..e9f7538d8 100644
--- a/theodolite-benchmarks/definitions/uc4-beam-flink/uc4-beam-flink-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc4-beam-flink/uc4-beam-flink-benchmark-operator.yaml
@@ -108,8 +108,3 @@ spec:
         repetitionAggregation: median
         operator: lte
         threshold: 100
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc4-beam-samza/uc4-beam-samza-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-beam-samza/uc4-beam-samza-benchmark-operator.yaml
index ceae2c326..32ed3e0af 100644
--- a/theodolite-benchmarks/definitions/uc4-beam-samza/uc4-beam-samza-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc4-beam-samza/uc4-beam-samza-benchmark-operator.yaml
@@ -29,6 +29,21 @@ spec:
             container: "zookeeper-client"
           command: ["bash", "-c", "bin/zkCli.sh -server $ZOOKEEPER_SERVER deleteall /app-theodolite-uc4-application-1"]
           timeoutSeconds: 60
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: "^theodolite-.*"
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: ".*samza.*"
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: ".*uc4-application.*"
   loadGenerator:
     resources:
       - configMap:
@@ -85,12 +100,3 @@ spec:
         threshold: 2000
         externalSloUrl: "http://localhost:80/evaluate-slope"
         warmup: 60 # in seconds
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
-      - name: ".*samza.*"
-        removeOnly: true
-      - name: ".*uc4-application.*"
-        removeOnly: true
\ No newline at end of file
diff --git a/theodolite-benchmarks/definitions/uc4-flink/uc4-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-flink/uc4-flink-benchmark-operator.yaml
index 02bf7a3b8..bcc91be73 100644
--- a/theodolite-benchmarks/definitions/uc4-flink/uc4-flink-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc4-flink/uc4-flink-benchmark-operator.yaml
@@ -108,8 +108,3 @@ spec:
         repetitionAggregation: median
         operator: lte
         threshold: 100
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc4-hazelcastjet/uc4-hazelcastjet-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-hazelcastjet/uc4-hazelcastjet-benchmark-operator.yaml
index 7b0d4bfc2..1efb8de02 100644
--- a/theodolite-benchmarks/definitions/uc4-hazelcastjet/uc4-hazelcastjet-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc4-hazelcastjet/uc4-hazelcastjet-benchmark-operator.yaml
@@ -83,8 +83,3 @@ spec:
         repetitionAggregation: median
         operator: lte
         threshold: 100
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
diff --git a/theodolite-benchmarks/definitions/uc4-kstreams/uc4-kstreams-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-kstreams/uc4-kstreams-benchmark-operator.yaml
index 99dadc3e5..ec466c077 100644
--- a/theodolite-benchmarks/definitions/uc4-kstreams/uc4-kstreams-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc4-kstreams/uc4-kstreams-benchmark-operator.yaml
@@ -20,6 +20,12 @@ spec:
             - "uc4-kstreams-service.yaml"
             - "uc4-jmx-configmap.yaml"
             - "uc4-service-monitor.yaml"
+    afterActions:
+      - delete:
+          selector:
+            apiVersion: kafka.strimzi.io/v1beta2
+            kind: KafkaTopic
+            nameRegex: "^theodolite-.*"
   loadGenerator:
     resources:
       - configMap:
@@ -88,8 +94,3 @@ spec:
         repetitionAggregation: median
         operator: lte
         threshold: 100
-  kafkaConfig:
-    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
-    topics:
-      - name: "theodolite-.*"
-        removeOnly: True
-- 
GitLab