[bitnami/kafka] Achieve consistent broker ids during cluster restart/rebuild (#2028)

* [bitnami/kafka] Connect broker id to MY_POD_NAME

Current charts leads to increasing broker ids after each restart/rebuild of
cluster when Persistent Volumes (PV) are not deleted during restart/rebuild. This is
often the case since PVs are usually used to persistent the log messages.

This commit provides a way to have deterministic broker ids after each cluster
restart/rebuild.

* Remove/comment dead code after connecting broker id with MY_POD_NAME

* Bump Chart version to 7.3.5

Co-authored-by: Guanghua Shu <guanghua.shu@oracle.com>
This commit is contained in:
Guanghua Shu
2020-03-16 02:01:20 -07:00
committed by GitHub
parent 21484d9088
commit 5622f3120a
2 changed files with 5 additions and 3 deletions

View File

@@ -151,8 +151,6 @@ spec:
{{- end }}
- name: ALLOW_PLAINTEXT_LISTENER
value: {{ ternary "yes" "no" (or .Values.auth.enabled .Values.allowPlaintextListener) | quote }}
- name: KAFKA_CFG_BROKER_ID
value: {{ .Values.brokerId | quote }}
- name: KAFKA_CFG_DELETE_TOPIC_ENABLE
value: {{ .Values.deleteTopicEnable | quote }}
- name: KAFKA_HEAP_OPTS
@@ -206,6 +204,10 @@ spec:
{{- if .Values.extraEnvVars }}
{{ include "kafka.tplValue" ( dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
command: ["/bin/bash", "-c"]
args:
- export KAFKA_CFG_BROKER_ID=${MY_POD_NAME##*-};
exec /entrypoint.sh /run.sh;
ports:
- name: kafka
containerPort: {{ .Values.service.port }}

View File

@@ -119,7 +119,7 @@ allowPlaintextListener: true
# interBrokerListenerName:
## ID of the Kafka node.
brokerId: -1
# brokerId: -1
## Switch to enable topic deletion or not.
deleteTopicEnable: false