bitnami/kafka add the ability to reference an existing cluster id secret (#19518)

* Added the ability to have a pre-configured kafka-cluster-id

Signed-off-by: Thomas Bell <thomas.bell@deepsee.ai>

* Updated the readme with documentation for new parameter

Signed-off-by: Thomas Bell <thomas.bell@deepsee.ai>

* Bumped the chart version number

Signed-off-by: Thomas Bell <thomas.bell@deepsee.ai>

* Update bitnami/kafka/Chart.yaml

Co-authored-by: Alberto Otero <aoterolorenzo@gmail.com>
Signed-off-by: Thomas Bell <thbell1985@gmail.com>

* Update bitnami/kafka/templates/broker/statefulset.yaml

Co-authored-by: Alberto Otero <aoterolorenzo@gmail.com>
Signed-off-by: Thomas Bell <thbell1985@gmail.com>

* Update bitnami/kafka/templates/controller-eligible/statefulset.yaml

Co-authored-by: Alberto Otero <aoterolorenzo@gmail.com>
Signed-off-by: Thomas Bell <thbell1985@gmail.com>

---------

Signed-off-by: Thomas Bell <thomas.bell@deepsee.ai>
Signed-off-by: Thomas Bell <thbell1985@gmail.com>
Co-authored-by: Thomas Bell <thomas.bell@deepsee.ai>
Co-authored-by: Alberto Otero <aoterolorenzo@gmail.com>
This commit is contained in:
Thomas Bell
2023-09-29 04:55:32 -06:00
committed by GitHub
parent afabe73c51
commit d3844a7b47
6 changed files with 12 additions and 9 deletions

View File

@@ -42,4 +42,4 @@ maintainers:
name: kafka
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/kafka
version: 25.1.12
version: 25.2.0

View File

@@ -620,11 +620,12 @@ The command removes all the Kubernetes components associated with the chart and
### KRaft chart parameters
| Name | Description | Value |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| `kraft.enabled` | Switch to enable or disable the KRaft mode for Kafka | `true` |
| `kraft.clusterId` | Kafka Kraft cluster ID. If not set, a random cluster ID will be generated the first time Kraft is initialized. | `""` |
| `kraft.controllerQuorumVoters` | Override the Kafka controller quorum voters of the Kafka Kraft cluster. If not set, it will be automatically configured to use all controller-elegible nodes. | `""` |
| Name | Description | Value |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| `kraft.enabled` | Switch to enable or disable the KRaft mode for Kafka | `true` |
| `kraft.existingClusterIdSecret` | Name of the secret containing the cluster ID for the Kafka KRaft cluster. This is incompatible with the clusterId parameter. If both are set, the existingClusterIdSecret will be used | `""` |
| `kraft.clusterId` | Kafka Kraft cluster ID. If not set, a random cluster ID will be generated the first time Kraft is initialized. | `""` |
| `kraft.controllerQuorumVoters` | Override the Kafka controller quorum voters of the Kafka Kraft cluster. If not set, it will be automatically configured to use all controller-elegible nodes. | `""` |
### ZooKeeper chart parameters

View File

@@ -152,7 +152,7 @@ spec:
- name: KAFKA_KRAFT_CLUSTER_ID
valueFrom:
secretKeyRef:
name: {{ printf "%s-kraft-cluster-id" (include "common.names.fullname" .) }}
name: {{ default (printf "%s-kraft-cluster-id" (include "common.names.fullname" .)) .Values.kraft.existingClusterIdSecret }}
key: kraft-cluster-id
{{- if .Values.broker.zookeeperMigrationMode }}
- name: KAFKA_SKIP_KRAFT_STORAGE_INIT

View File

@@ -151,7 +151,7 @@ spec:
- name: KAFKA_KRAFT_CLUSTER_ID
valueFrom:
secretKeyRef:
name: {{ printf "%s-kraft-cluster-id" (include "common.names.fullname" .) }}
name: {{ default (printf "%s-kraft-cluster-id" (include "common.names.fullname" .)) .Values.kraft.existingClusterIdSecret }}
key: kraft-cluster-id
{{- if and (include "kafka.saslEnabled" .) (or (regexFind "SCRAM" (upper .Values.sasl.enabledMechanisms)) (regexFind "SCRAM" (upper .Values.sasl.controllerMechanism)) (regexFind "SCRAM" (upper .Values.sasl.interBrokerMechanism))) }}
- name: KAFKA_KRAFT_BOOTSTRAP_SCRAM_USERS

View File

@@ -104,7 +104,7 @@ data:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.kraft.enabled }}
{{- if and .Values.kraft.enabled (not .Values.kraft.existingClusterIdSecret) }}
---
apiVersion: v1
kind: Secret

View File

@@ -2285,6 +2285,8 @@ kraft:
## @param kraft.enabled Switch to enable or disable the KRaft mode for Kafka
##
enabled: true
## @param kraft.existingClusterIdSecret Name of the secret containing the cluster ID for the Kafka KRaft cluster. This is incompatible with the clusterId parameter. If both are set, the existingClusterIdSecret will be used
existingClusterIdSecret: ""
## @param kraft.clusterId Kafka Kraft cluster ID. If not set, a random cluster ID will be generated the first time Kraft is initialized.
## NOTE: Already initialized Kafka nodes will use cluster ID stored in their persisted storage.
## If reusing existing PVCs or migrating from Zookeeper mode, make sure the cluster ID is set matching the stored cluster ID, otherwise new nodes will fail to join the cluster.