[DMAAP][MR] Allow kafka to run with < 3 replicas 84/124284/9
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 16 Sep 2021 06:38:01 +0000 (08:38 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Fri, 10 Dec 2021 12:07:12 +0000 (13:07 +0100)
Current hardcoded configuration doesn't allow kafka to be run with less
than 3 replicas.
This patch fixes this

Issue-ID: OOM-2831
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: Iffd78a3eaa808e62a74fbc08f26e19f1644440df

kubernetes/dmaap/components/message-router/components/message-router-kafka/templates/statefulset.yaml
kubernetes/dmaap/components/message-router/components/message-router-kafka/values.yaml

index 7cedbf8..ebb5f7e 100644 (file)
@@ -169,6 +169,12 @@ spec:
           value: "{{ include "common.kafkaNodes" (dict "dot" . "replicaCount" .Values.zookeeper.replicaCount "componentName" .Values.zookeeper.name "port" .Values.zookeeper.port ) }}"
         - name: KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE
           value: "{{ .Values.kafka.enableSupport }}"
+        - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
+          value: "{{ .Values.config.offsets_topic_replication_factor | default .Values.replicaCount }}"
+        - name: KAFKA_NUM_PARTITIONS
+          value: "{{ .Values.config.num_partition | default .Values.replicaCount }}"
+        - name:  KAFKA_DEFAULT_REPLICATION_FACTOR
+          value: "{{ .Values.config.default_replication_factor | default .Values.replicaCount }}"
         {{- if  .Values.global.aafEnabled }}
         - name: KAFKA_OPTS
           value: "{{ .Values.kafka.jaasOptionsAaf }}"
index 16a4c0f..be0de96 100644 (file)
@@ -77,17 +77,18 @@ kafka:
   interBrokerListernerAaf: INTERNAL_SASL_PLAINTEXT
   interBrokerListerner: INTERNAL_PLAINTEXT
 
+config: {}
+  # offsets_topic_replication_factor:
+  # num_partition:
+  # default_replication_factor:
 
 configurationOverrides:
-  "offsets.topic.replication.factor": "3"
   "log.dirs": "/var/lib/kafka/data"
   "log.retention.hours": "168"
-  "num.partitions": "3"
   "transaction.state.log.replication.factor": "1"
   "transaction.state.log.min.isr": "1"
   "num.recovery.threads.per.data.dir": "5"
   "zookeeper.connection.timeout.ms": "6000"
-  "default.replication.factor": "3"
   "zookeeper.set.acl": "true"
 
 jmx: