From ad24275f27a8b6f5e8bf00896e9e939b6c2fa4bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Wed, 14 Apr 2021 14:28:19 +0200
Subject: [PATCH] Add examples for operator

---
 .../config/example-operator-benchmark.yaml    | 31 +++++++++++
 .../config/example-operator-execution.yaml    | 52 +++++++++++++++++++
 2 files changed, 83 insertions(+)
 create mode 100644 theodolite-quarkus/config/example-operator-benchmark.yaml
 create mode 100644 theodolite-quarkus/config/example-operator-execution.yaml

diff --git a/theodolite-quarkus/config/example-operator-benchmark.yaml b/theodolite-quarkus/config/example-operator-benchmark.yaml
new file mode 100644
index 000000000..419042fdd
--- /dev/null
+++ b/theodolite-quarkus/config/example-operator-benchmark.yaml
@@ -0,0 +1,31 @@
+apiVersion: theodolite.com/v1alpha1
+kind: benchmark
+metadata:
+  name: uc1-kstreams
+#name: "uc1-kstreams"
+appResource:
+  - "uc1-kstreams-deployment.yaml"
+  - "aggregation-service.yaml"
+  - "jmx-configmap.yaml"
+  - "uc1-service-monitor.yaml"
+loadGenResource:
+  - "uc1-load-generator-deployment.yaml"
+  - "uc1-load-generator-service.yaml"
+resourceTypes:
+  - typeName: "Instances"
+    patchers:
+      - type: "ReplicaPatcher"
+        resource: "uc1-kstreams-deployment.yaml"
+loadTypes:
+  - typeName: "NumSensors"
+    patchers:
+      - type: "EnvVarPatcher"
+        resource: "uc1-load-generator-deployment.yaml"
+        container: "workload-generator"
+        variableName: "NUM_SENSORS"
+kafkaConfig:
+  bootstrapServer: "theodolite-cp-kafka:9092"
+  topics:
+    - name: "input"
+      numPartitions: 40
+      replicationFactor: 1
\ No newline at end of file
diff --git a/theodolite-quarkus/config/example-operator-execution.yaml b/theodolite-quarkus/config/example-operator-execution.yaml
new file mode 100644
index 000000000..3df1a723d
--- /dev/null
+++ b/theodolite-quarkus/config/example-operator-execution.yaml
@@ -0,0 +1,52 @@
+apiVersion: theodolite.com/v1alpha1
+kind: execution
+metadata:
+  name: example-execution
+#name: example-execution
+benchmark: "uc1-kstreams"
+load:
+  loadType: "NumSensors"
+  loadValues: [25000, 50000, 75000, 100000, 125000, 150000]
+resources:
+  resourceType: "Instances"
+  resourceValues: [1, 2, 3, 4, 5]
+slos:
+  - sloType: "lag trend"
+    threshold: 2000
+    prometheusUrl: "http://prometheus-operated:9090"
+    externalSloUrl: "http://localhost:80/evaluate-slope"
+    offset: 0
+    warmup: 60 # in seconds
+execution:
+  strategy: "LinearSearch"
+  duration: 300 # in seconds
+  repetitions: 1
+  restrictions:
+    - "LowerBound"
+configOverrides: []
+#  - patcher:
+#      type: "NodeSelectorPatcher"
+#      resource: "uc1-load-generator-deployment.yaml"
+#      variableName: "env"
+#    value: "prod"
+#  - patcher:
+#      type: "NodeSelectorPatcher"
+#      resource: "uc1-kstreams-deployment.yaml"
+#      variableName: "env"
+#    value: "prod"
+#  - patcher:
+#      type: "ResourceLimitPatcher"
+#      resource: "uc1-kstreams-deployment.yaml"
+#      container: "uc-application"
+#      variableName: "cpu"
+#    value: "1000m"
+#  - patcher:
+#      type: "ResourceLimitPatcher"
+#      resource: "uc1-kstreams-deployment.yaml"
+#      container: "uc-application"
+#      variableName: "memory"
+#    value: "2Gi"
+#  - patcher:
+#      type: "SchedulerNamePatcher"
+#      resource: "uc1-kstreams-deployment.yaml"
+#    value: "random-scheduler"
-- 
GitLab