[bitnami/kafka] fix: Setup of sasl authentication to external zookeeper (#23550)

Signed-off-by: Christian Kuhn <phello@gmx.de>
Signed-off-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
Signed-off-by: Rafael Ríos Saavedra <rrios@vmware.com>
Co-authored-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
Co-authored-by: Rafael Ríos Saavedra <rrios@vmware.com>
This commit is contained in:
Christian Kuhn
2024-03-11 11:05:14 +01:00
committed by GitHub
parent 9b9b51888c
commit ac9dca4a19
4 changed files with 18 additions and 6 deletions

View File

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

View File

@@ -676,11 +676,6 @@ Zookeeper connection section of the server.properties
{{- define "kafka.zookeeperConfig" -}}
zookeeper.connect={{ include "kafka.zookeeperConnect" . }}
#broker.id=
{{- if .Values.sasl.zookeeper.user }}
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required \
username="{{ .Values.sasl.zookeeper.user }}" \
password="zookeeper-password-placeholder";
{{- end }}
{{- if and .Values.tls.zookeeper.enabled .Values.tls.zookeeper.existingSecret }}
zookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty
zookeeper.ssl.client.enable=true

View File

@@ -306,6 +306,11 @@ spec:
- name: kafka-config
mountPath: /opt/bitnami/kafka/config/server.properties
subPath: server.properties
{{- if .Values.sasl.zookeeper.user }}
- name: kafka-config
mountPath: /opt/bitnami/kafka/config/kafka_jaas.conf
subPath: kafka_jaas.conf
{{- end }}
- name: tmp
mountPath: /tmp
{{- if or .Values.log4j .Values.existingLog4jConfigMap }}

View File

@@ -322,6 +322,18 @@ data:
fi
{{- end }}
{{- if .Values.sasl.zookeeper.user }}
export KAFKA_CONFIG_FILE=/config/kafka_jaas.conf
cat << EOF > /config/kafka_jaas.conf
Client {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="{{ .Values.sasl.zookeeper.user }}"
password="zookeeper-password-placeholder";
};
EOF
replace_placeholder "zookeeper-password-placeholder" "$KAFKA_ZOOKEEPER_PASSWORD"
{{- end }}
export KAFKA_CONFIG_FILE=/config/server.properties
cp /configmaps/server.properties $KAFKA_CONFIG_FILE