From 4581d743c87092b9cff7423243dd23794e34f0a5 Mon Sep 17 00:00:00 2001
From: Simon Ehrenstein <simon.ehrenstein@gmail.com>
Date: Fri, 18 Feb 2022 13:34:44 +0100
Subject: [PATCH] Improve structure of helm chart

---
 helm/Chart.yaml                               |  1 +
 helm/templates/strimzi/kafka-cluster.yaml     | 13 ----------
 ...nfig.yaml => kafka-metrics-configmap.yaml} |  0
 helm/values.yaml                              | 25 ++++++++++++++-----
 4 files changed, 20 insertions(+), 19 deletions(-)
 rename helm/templates/strimzi/{kafka-config.yaml => kafka-metrics-configmap.yaml} (100%)

diff --git a/helm/Chart.yaml b/helm/Chart.yaml
index e3307341c..d19c40610 100644
--- a/helm/Chart.yaml
+++ b/helm/Chart.yaml
@@ -27,6 +27,7 @@ dependencies:
   - name: strimzi-kafka-operator
     version: 0.27.1
     repository: https://strimzi.io/charts/
+    condition: strimzi-kafka-operator.enabled
 
 
 version: 0.7.0-SNAPSHOT
diff --git a/helm/templates/strimzi/kafka-cluster.yaml b/helm/templates/strimzi/kafka-cluster.yaml
index 87f5e67c6..cb427681e 100644
--- a/helm/templates/strimzi/kafka-cluster.yaml
+++ b/helm/templates/strimzi/kafka-cluster.yaml
@@ -5,30 +5,17 @@ metadata:
 spec:
   kafka:
     jmxOptions: {}
-    listeners:
-      - name: plain
-        port: 9092
-        type: internal
-        tls: false
     storage:
       type: ephemeral
-    replicas: 3
     metricsConfig:
       type: jmxPrometheusExporter
       valueFrom:
         configMapKeyRef:
           name: kafka-metrics
           key: kafka-metrics-config.yml
-    config:
-      message.max.bytes: "134217728" # 128 MB
-      replica.fetch.max.bytes: "134217728" #128 MB
-      auto.create.topics.enable: false
-      log.retention.ms: "7200000" # 2h
-      metrics.sample.window.ms: "5000" #5s
   
   kafkaExporter: {}
 
   zookeeper:
-    replicas: 3
     storage:
       type: ephemeral
diff --git a/helm/templates/strimzi/kafka-config.yaml b/helm/templates/strimzi/kafka-metrics-configmap.yaml
similarity index 100%
rename from helm/templates/strimzi/kafka-config.yaml
rename to helm/templates/strimzi/kafka-metrics-configmap.yaml
diff --git a/helm/values.yaml b/helm/values.yaml
index 672409490..123673469 100644
--- a/helm/values.yaml
+++ b/helm/values.yaml
@@ -156,12 +156,25 @@ cp-helm-charts:
   ## The interval between refreshing metrics
   pollIntervalSeconds: 15
 
-  prometheus:
-    serviceMonitor:
-      enabled: true
-      interval: "5s"
-      additionalLabels:
-        appScope: titan-ccp
+strimzi-kafka-operator:
+  enabled: true
+
+  kafka:
+    listeners:
+      - name: plain
+        port: 9092
+        type: internal
+        tls: false
+    replicas: 3
+    config:
+      message.max.bytes: "134217728" # 128 MB
+      replica.fetch.max.bytes: "134217728" #128 MB
+      auto.create.topics.enable: false
+      log.retention.ms: "7200000" # 2h
+      metrics.sample.window.ms: "5000" #5s
+  
+  zookeeper:
+    replicas: 3
 
 
 ###
-- 
GitLab