diff --git a/bitnami/kafka/CHANGELOG.md b/bitnami/kafka/CHANGELOG.md index 34ba9ec55f115e..9b501f05af991e 100644 --- a/bitnami/kafka/CHANGELOG.md +++ b/bitnami/kafka/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 29.2.0 (2024-05-30) + +* [bitnami/kafka] Add support for helm parameter maps for kafka config, closes ([#25646](https://github.com/bitnami/charts/issues/25646)) + ## 29.1.2 (2024-05-29) * [bitnami/kafka] PDB review ([#25938](https://github.com/bitnami/charts/pull/25938)) diff --git a/bitnami/kafka/Chart.yaml b/bitnami/kafka/Chart.yaml index c9230a25e14aca..a7b3820fe0a4ad 100644 --- a/bitnami/kafka/Chart.yaml +++ b/bitnami/kafka/Chart.yaml @@ -40,4 +40,4 @@ maintainers: name: kafka sources: - https://github.com/bitnami/charts/tree/main/bitnami/kafka -version: 29.1.2 +version: 29.2.0 diff --git a/bitnami/kafka/README.md b/bitnami/kafka/README.md index 5e687e2eb382fc..50214eca351caa 100644 --- a/bitnami/kafka/README.md +++ b/bitnami/kafka/README.md @@ -447,6 +447,7 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru | `config` | Configuration file for Kafka, rendered as a template. Auto-generated based on chart values when not specified. | `""` | | `existingConfigmap` | ConfigMap with Kafka Configuration | `""` | | `extraConfig` | Additional configuration to be appended at the end of the generated Kafka configuration file. | `""` | +| `extraConfigYaml` | Additional configuration in yaml format to be appended at the end of the generated Kafka configuration file. | `{}` | | `secretConfig` | Additional configuration to be appended at the end of the generated Kafka configuration file. | `""` | | `existingSecretConfig` | Secret with additonal configuration that will be appended to the end of the generated Kafka configuration file | `""` | | `log4j` | An optional log4j.properties file to overwrite the default of the Kafka brokers | `""` | @@ -551,6 +552,7 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru | `controller.config` | Configuration file for Kafka controller-eligible nodes, rendered as a template. Auto-generated based on chart values when not specified. | `""` | | `controller.existingConfigmap` | ConfigMap with Kafka Configuration for controller-eligible nodes. | `""` | | `controller.extraConfig` | Additional configuration to be appended at the end of the generated Kafka controller-eligible nodes configuration file. | `""` | +| `controller.extraConfigYaml` | Additional configuration in yaml format to be appended at the end of the generated Kafka controller-eligible nodes configuration file. | `{}` | | `controller.secretConfig` | Additional configuration to be appended at the end of the generated Kafka controller-eligible nodes configuration file. | `""` | | `controller.existingSecretConfig` | Secret with additonal configuration that will be appended to the end of the generated Kafka controller-eligible nodes configuration file | `""` | | `controller.heapOpts` | Kafka Java Heap size for controller-eligible nodes | `-Xmx1024m -Xms1024m` | @@ -675,6 +677,7 @@ You can enable this initContainer by setting `volumePermissions.enabled` to `tru | `broker.config` | Configuration file for Kafka broker-only nodes, rendered as a template. Auto-generated based on chart values when not specified. | `""` | | `broker.existingConfigmap` | ConfigMap with Kafka Configuration for broker-only nodes. | `""` | | `broker.extraConfig` | Additional configuration to be appended at the end of the generated Kafka broker-only nodes configuration file. | `""` | +| `broker.extraConfigYaml` | Additional configuration in yaml format to be appended at the end of the generated Kafka broker-only nodes configuration file. | `{}` | | `broker.secretConfig` | Additional configuration to be appended at the end of the generated Kafka broker-only nodes configuration file. | `""` | | `broker.existingSecretConfig` | Secret with additonal configuration that will be appended to the end of the generated Kafka broker-only nodes configuration file | `""` | | `broker.heapOpts` | Kafka Java Heap size for broker-only nodes | `-Xmx1024m -Xms1024m` | diff --git a/bitnami/kafka/templates/_helpers.tpl b/bitnami/kafka/templates/_helpers.tpl index cf12a096a34f93..288bef70fff968 100644 --- a/bitnami/kafka/templates/_helpers.tpl +++ b/bitnami/kafka/templates/_helpers.tpl @@ -1219,3 +1219,10 @@ kafka: Missing KRaft or Zookeeper mode settings Please configure 'kraft.enabled', 'zookeeper.enabled' or `externalZookeeper.servers` before proceeding. {{- end -}} {{- end -}} + +{{/* Render key, value as proprties format */}} +{{- define "kafka.properties.render" -}} +{{- range $key, $value := . }} +{{ $key }}={{ include "common.tplvalues.render" (dict "value" $value "context" $) }} +{{- end -}} +{{- end -}} diff --git a/bitnami/kafka/templates/broker/configmap.yaml b/bitnami/kafka/templates/broker/configmap.yaml index 94fef9fa1a8ec8..03d41c765f5e85 100644 --- a/bitnami/kafka/templates/broker/configmap.yaml +++ b/bitnami/kafka/templates/broker/configmap.yaml @@ -44,8 +44,13 @@ data: log.dir={{ printf "%s/data" .Values.broker.persistence.mountPath }} # Kafka application logs directory logs.dir={{ .Values.broker.logPersistence.mountPath }} + + # Common Kafka Configuration {{- include "kafka.commonConfig" . | nindent 4 }} + + # Custom Kafka Configuration {{- include "common.tplvalues.render" ( dict "value" .Values.extraConfig "context" $ ) | nindent 4 }} {{- include "common.tplvalues.render" ( dict "value" .Values.broker.extraConfig "context" $ ) | nindent 4 }} + {{- include "kafka.properties.render" (merge .Values.broker.extraConfigYaml .Values.extraConfigYaml ) | nindent 4 }} {{- end }} {{- end }} diff --git a/bitnami/kafka/templates/controller-eligible/configmap.yaml b/bitnami/kafka/templates/controller-eligible/configmap.yaml index ed688767cf0bc1..9fcaf342c62fdb 100644 --- a/bitnami/kafka/templates/controller-eligible/configmap.yaml +++ b/bitnami/kafka/templates/controller-eligible/configmap.yaml @@ -43,8 +43,13 @@ data: log.dir={{ printf "%s/data" .Values.controller.persistence.mountPath }} # Kafka application logs directory logs.dir={{ .Values.controller.logPersistence.mountPath }} + + # Common Kafka Configuration {{- include "kafka.commonConfig" . | nindent 4 }} + + # Custom Kafka Configuration {{- include "common.tplvalues.render" ( dict "value" .Values.extraConfig "context" $ ) | nindent 4 }} {{- include "common.tplvalues.render" ( dict "value" .Values.controller.extraConfig "context" $ ) | nindent 4 }} + {{- include "kafka.properties.render" (merge .Values.controller.extraConfigYaml .Values.extraConfigYaml) | nindent 4 }} {{- end }} {{- end }} diff --git a/bitnami/kafka/values.yaml b/bitnami/kafka/values.yaml index 42553d107a9d3e..ebc65277cfc0ab 100644 --- a/bitnami/kafka/values.yaml +++ b/bitnami/kafka/values.yaml @@ -118,6 +118,13 @@ existingConfigmap: "" ## @param extraConfig Additional configuration to be appended at the end of the generated Kafka configuration file. ## extraConfig: "" +## @param extraConfigYaml Additional configuration in yaml format to be appended at the end of the generated Kafka configuration file. +## +## E.g. +## extraConfigYaml: +## default.replication.factor: 3 +## +extraConfigYaml: {} ## @param secretConfig Additional configuration to be appended at the end of the generated Kafka configuration file. ## This value will be stored in a secret. ## @@ -499,6 +506,10 @@ controller: ## @param controller.extraConfig Additional configuration to be appended at the end of the generated Kafka controller-eligible nodes configuration file. ## extraConfig: "" + ## @param controller.extraConfigYaml Additional configuration in yaml format to be appended at the end of the generated Kafka controller-eligible nodes configuration file. + ## If keys of extraConfigYaml are duplicated here, the value from controller.extraConfigYaml is taken. + ## + extraConfigYaml: {} ## @param controller.secretConfig Additional configuration to be appended at the end of the generated Kafka controller-eligible nodes configuration file. ## This value will be stored in a secret. ## @@ -953,6 +964,10 @@ broker: ## @param broker.extraConfig Additional configuration to be appended at the end of the generated Kafka broker-only nodes configuration file. ## extraConfig: "" + ## @param broker.extraConfigYaml Additional configuration in yaml format to be appended at the end of the generated Kafka broker-only nodes configuration file. + ## If keys of extraConfigYaml are duplicated here, the value from broker.extraConfigYaml is taken. + ## + extraConfigYaml: {} ## @param broker.secretConfig Additional configuration to be appended at the end of the generated Kafka broker-only nodes configuration file. ## This value will be stored in a secret. ##