Skip to content

Commit fa1ff25

Browse files
authored
[bitnami/kafka] Release kafka-4.0.0-debian-12-r1 (#79548)
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
1 parent 63d395b commit fa1ff25

File tree

6 files changed

+54
-60
lines changed

6 files changed

+54
-60
lines changed

bitnami/kafka/4.0/debian-12/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ ARG TARGETARCH
99

1010
LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \
1111
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
12-
org.opencontainers.image.created="2025-03-24T10:56:38Z" \
12+
org.opencontainers.image.created="2025-04-05T19:16:44Z" \
1313
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
1414
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/kafka/README.md" \
15-
org.opencontainers.image.ref.name="4.0.0-debian-12-r0" \
15+
org.opencontainers.image.ref.name="4.0.0-debian-12-r1" \
1616
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/kafka" \
1717
org.opencontainers.image.title="kafka" \
1818
org.opencontainers.image.vendor="Broadcom, Inc." \
@@ -29,7 +29,6 @@ SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"]
2929
RUN install_packages ca-certificates curl procps zlib1g
3030
RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \
3131
COMPONENTS=( \
32-
"wait-for-port-1.0.8-14-linux-${OS_ARCH}-debian-12" \
3332
"jre-17.0.14-10-1-linux-${OS_ARCH}-debian-12" \
3433
"kafka-4.0.0-0-linux-${OS_ARCH}-debian-12" \
3534
) ; \
@@ -55,7 +54,7 @@ RUN /opt/bitnami/scripts/kafka/postunpack.sh
5554
ENV APP_VERSION="4.0.0" \
5655
BITNAMI_APP_NAME="kafka" \
5756
JAVA_HOME="/opt/bitnami/java" \
58-
PATH="/opt/bitnami/common/bin:/opt/bitnami/java/bin:/opt/bitnami/kafka/bin:$PATH"
57+
PATH="/opt/bitnami/java/bin:/opt/bitnami/kafka/bin:$PATH"
5958

6059
EXPOSE 9092
6160

bitnami/kafka/4.0/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,5 @@
1010
"distro": "debian-12",
1111
"type": "NAMI",
1212
"version": "4.0.0-0"
13-
},
14-
"wait-for-port": {
15-
"arch": "amd64",
16-
"distro": "debian-12",
17-
"type": "NAMI",
18-
"version": "1.0.8-14"
1913
}
2014
}

bitnami/kafka/4.0/debian-12/prebuildfs/opt/bitnami/scripts/libvalidations.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -277,22 +277,12 @@ validate_string() {
277277
return 1
278278
;;
279279
*)
280-
break
280+
string="$1"
281281
;;
282282
esac
283283
shift
284284
done
285285

286-
if [ "$#" -gt 1 ]; then
287-
stderr_print "too many arguments provided"
288-
return 2
289-
elif [ "$#" -eq 0 ]; then
290-
stderr_print "missing string"
291-
return 1
292-
else
293-
string=$1
294-
fi
295-
296286
if [[ "$min_length" -ge 0 ]] && [[ "${#string}" -lt "$min_length" ]]; then
297287
echo "string length is less than $min_length"
298288
return 1

bitnami/kafka/4.0/debian-12/rootfs/opt/bitnami/scripts/kafka-env.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ kafka_env_vars=(
3434
KAFKA_ZOOKEEPER_PROTOCOL
3535
KAFKA_ZOOKEEPER_PASSWORD
3636
KAFKA_ZOOKEEPER_USER
37+
KAFKA_ZOOKEEPER_TLS_TYPE
38+
KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE
3739
KAFKA_ZOOKEEPER_TLS_KEYSTORE_PASSWORD
3840
KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_PASSWORD
39-
KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE
4041
KAFKA_ZOOKEEPER_TLS_VERIFY_HOSTNAME
41-
KAFKA_ZOOKEEPER_TLS_TYPE
4242
KAFKA_INTER_BROKER_USER
4343
KAFKA_INTER_BROKER_PASSWORD
4444
KAFKA_CONTROLLER_USER
@@ -98,11 +98,11 @@ export KAFKA_OPTS="${KAFKA_OPTS:-}"
9898
export KAFKA_ZOOKEEPER_PROTOCOL="${KAFKA_ZOOKEEPER_PROTOCOL:-PLAINTEXT}"
9999
export KAFKA_ZOOKEEPER_PASSWORD="${KAFKA_ZOOKEEPER_PASSWORD:-}"
100100
export KAFKA_ZOOKEEPER_USER="${KAFKA_ZOOKEEPER_USER:-}"
101+
export KAFKA_ZOOKEEPER_TLS_TYPE="${KAFKA_ZOOKEEPER_TLS_TYPE:-JKS}"
102+
export KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE="${KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE:-}"
101103
export KAFKA_ZOOKEEPER_TLS_KEYSTORE_PASSWORD="${KAFKA_ZOOKEEPER_TLS_KEYSTORE_PASSWORD:-}"
102104
export KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_PASSWORD="${KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_PASSWORD:-}"
103-
export KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE="${KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE:-}"
104105
export KAFKA_ZOOKEEPER_TLS_VERIFY_HOSTNAME="${KAFKA_ZOOKEEPER_TLS_VERIFY_HOSTNAME:-true}"
105-
export KAFKA_ZOOKEEPER_TLS_TYPE="${KAFKA_ZOOKEEPER_TLS_TYPE:-JKS}"
106106

107107
# Authentication
108108
export KAFKA_INTER_BROKER_USER="${KAFKA_INTER_BROKER_USER:-user}"

bitnami/kafka/4.0/debian-12/rootfs/opt/bitnami/scripts/libkafka.sh

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ kafka_get_version() {
103103

104104
########################
105105
# Returns true if ZooKeeper is supported as metadata storage
106+
# Globals:
107+
# None
108+
# Arguments:
109+
# None
110+
# Returns:
111+
# true/false
112+
#########################
106113
kafka_is_zookeeper_supported() {
107114
major_version="$(get_sematic_version "$(kafka_get_version)" 1)"
108115
if [[ "$major_version" -lt "4" ]]; then
@@ -943,7 +950,9 @@ kafka_initialize() {
943950
cp -Lr "$KAFKA_MOUNTED_CONF_DIR"/* "$KAFKA_CONF_DIR"
944951
fi
945952
# Copy truststore to cert directory
946-
for cert_var in KAFKA_TLS_TRUSTSTORE_FILE KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE; do
953+
local -a certs_vars=("KAFKA_TLS_TRUSTSTORE_FILE")
954+
kafka_is_zookeeper_supported && certs_vars+=("KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE")
955+
for cert_var in "${certs_vars[@]}"; do
947956
# Only copy if the file exists and it is in a different location than KAFKA_CERTS_DIR (to avoid copying to the same location)
948957
if [[ -f "${!cert_var}" ]] && ! [[ "${!cert_var}" =~ $KAFKA_CERTS_DIR ]]; then
949958
info "Copying truststore ${!cert_var} to ${KAFKA_CERTS_DIR}"
@@ -995,41 +1004,43 @@ kafka_initialize() {
9951004
kafka_server_conf_set sasl.enabled.mechanisms "$KAFKA_CFG_SASL_ENABLED_MECHANISMS"
9961005
fi
9971006
# Settings for each Kafka Listener are configured individually
998-
read -r -a protocol_maps <<<"$(tr ',' ' ' <<<"$KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP")"
999-
for protocol_map in "${protocol_maps[@]}"; do
1000-
read -r -a map <<<"$(tr ':' ' ' <<<"$protocol_map")"
1001-
# Obtain the listener and protocol from protocol map string, e.g. CONTROLLER:PLAINTEXT
1002-
listener="${map[0]}"
1003-
protocol="${map[1]}"
1004-
listener_lower="$(echo "$listener" | tr '[:upper:]' '[:lower:]')"
1007+
if ! is_empty_value "${KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP:-}"; then
1008+
read -r -a protocol_maps <<<"$(tr ',' ' ' <<<"$KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP")"
1009+
for protocol_map in "${protocol_maps[@]}"; do
1010+
read -r -a map <<<"$(tr ':' ' ' <<<"$protocol_map")"
1011+
# Obtain the listener and protocol from protocol map string, e.g. CONTROLLER:PLAINTEXT
1012+
listener="${map[0]}"
1013+
protocol="${map[1]}"
1014+
listener_lower="$(echo "$listener" | tr '[:upper:]' '[:lower:]')"
10051015

1006-
if [[ "$protocol" = "SSL" || "$protocol" = "SASL_SSL" ]]; then
1007-
listener_upper="$(echo "$listener" | tr '[:lower:]' '[:upper:]')"
1008-
env_name="KAFKA_TLS_${listener_upper}_CLIENT_AUTH"
1009-
[[ -n "${!env_name:-}" ]] && kafka_server_conf_set "listener.name.${listener_lower}.ssl.client.auth" "${!env_name}"
1010-
fi
1011-
if [[ "$protocol" = "SASL_PLAINTEXT" || "$protocol" = "SASL_SSL" ]]; then
1012-
local role=""
1013-
if [[ "$listener" = "${KAFKA_CFG_INTER_BROKER_LISTENER_NAME:-INTERNAL}" ]]; then
1014-
kafka_server_conf_set sasl.mechanism.inter.broker.protocol "$KAFKA_CFG_SASL_MECHANISM_INTER_BROKER_PROTOCOL"
1015-
role="inter-broker"
1016-
elif [[ "${KAFKA_CFG_CONTROLLER_LISTENER_NAMES:-CONTROLLER}" =~ $listener ]]; then
1017-
kafka_server_conf_set sasl.mechanism.controller.protocol "$KAFKA_CFG_SASL_MECHANISM_CONTROLLER_PROTOCOL"
1018-
kafka_server_conf_set "listener.name.${listener_lower}.sasl.enabled.mechanisms" "$KAFKA_CFG_SASL_MECHANISM_CONTROLLER_PROTOCOL"
1019-
role="controller"
1020-
fi
1021-
# If KAFKA_CLIENT_LISTENER_NAME is found in the listeners list, configure the producer/consumer accordingly
1022-
if [[ "$listener" = "${KAFKA_CLIENT_LISTENER_NAME:-CLIENT}" ]]; then
1023-
kafka_configure_consumer_producer_jaas
1024-
kafka_producer_consumer_conf_set security.protocol "$protocol"
1025-
kafka_producer_consumer_conf_set sasl.mechanism "${KAFKA_CLIENT_SASL_MECHANISM:-$(kafka_client_sasl_mechanism)}"
1016+
if [[ "$protocol" = "SSL" || "$protocol" = "SASL_SSL" ]]; then
1017+
listener_upper="$(echo "$listener" | tr '[:lower:]' '[:upper:]')"
1018+
env_name="KAFKA_TLS_${listener_upper}_CLIENT_AUTH"
1019+
[[ -n "${!env_name:-}" ]] && kafka_server_conf_set "listener.name.${listener_lower}.ssl.client.auth" "${!env_name}"
10261020
fi
1027-
# Configure inline listener jaas configuration, omitted if mounted JAAS conf file detected
1028-
if [[ ! -f "${KAFKA_CONF_DIR}/kafka_jaas.conf" ]]; then
1029-
kafka_configure_server_jaas "$listener_lower" "${role:-}"
1021+
if [[ "$protocol" = "SASL_PLAINTEXT" || "$protocol" = "SASL_SSL" ]]; then
1022+
local role=""
1023+
if [[ "$listener" = "${KAFKA_CFG_INTER_BROKER_LISTENER_NAME:-INTERNAL}" ]]; then
1024+
kafka_server_conf_set sasl.mechanism.inter.broker.protocol "$KAFKA_CFG_SASL_MECHANISM_INTER_BROKER_PROTOCOL"
1025+
role="inter-broker"
1026+
elif [[ "${KAFKA_CFG_CONTROLLER_LISTENER_NAMES:-CONTROLLER}" =~ $listener ]]; then
1027+
kafka_server_conf_set sasl.mechanism.controller.protocol "$KAFKA_CFG_SASL_MECHANISM_CONTROLLER_PROTOCOL"
1028+
kafka_server_conf_set "listener.name.${listener_lower}.sasl.enabled.mechanisms" "$KAFKA_CFG_SASL_MECHANISM_CONTROLLER_PROTOCOL"
1029+
role="controller"
1030+
fi
1031+
# If KAFKA_CLIENT_LISTENER_NAME is found in the listeners list, configure the producer/consumer accordingly
1032+
if [[ "$listener" = "${KAFKA_CLIENT_LISTENER_NAME:-CLIENT}" ]]; then
1033+
kafka_configure_consumer_producer_jaas
1034+
kafka_producer_consumer_conf_set security.protocol "$protocol"
1035+
kafka_producer_consumer_conf_set sasl.mechanism "${KAFKA_CLIENT_SASL_MECHANISM:-$(kafka_client_sasl_mechanism)}"
1036+
fi
1037+
# Configure inline listener jaas configuration, omitted if mounted JAAS conf file detected
1038+
if [[ ! -f "${KAFKA_CONF_DIR}/kafka_jaas.conf" ]]; then
1039+
kafka_configure_server_jaas "$listener_lower" "${role:-}"
1040+
fi
10301041
fi
1031-
fi
1032-
done
1042+
done
1043+
fi
10331044
# Configure Kafka using environment variables
10341045
# This is executed at the end, to allow users to override properties set by the initialization logic
10351046
kafka_configure_from_environment_variables

bitnami/kafka/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ docker-compose up -d
194194
| `KAFKA_ZOOKEEPER_PROTOCOL` | Authentication protocol for Zookeeper connections. Allowed protocols: `PLAINTEXT`, `SASL, SSL`, and `SASL_SSL`. | `PLAINTEXT` |
195195
| `KAFKA_ZOOKEEPER_PASSWORD` | Kafka Zookeeper user password for SASL authentication. | `nil` |
196196
| `KAFKA_ZOOKEEPER_USER` | Kafka Zookeeper user for SASL authentication. | `nil` |
197+
| `KAFKA_ZOOKEEPER_TLS_TYPE` | Choose the TLS certificate format to use. Allowed values: `JKS`, `PEM`. | `JKS` |
198+
| `KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE` | Kafka Zookeeper truststore file location. | `nil` |
197199
| `KAFKA_ZOOKEEPER_TLS_KEYSTORE_PASSWORD` | Kafka Zookeeper keystore file password and key password. | `nil` |
198200
| `KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_PASSWORD` | Kafka Zookeeper truststore file password. | `nil` |
199-
| `KAFKA_ZOOKEEPER_TLS_TRUSTSTORE_FILE` | Kafka Zookeeper truststore file location. | `nil` |
200201
| `KAFKA_ZOOKEEPER_TLS_VERIFY_HOSTNAME` | Verify Zookeeper hostname on TLS certificates. | `true` |
201-
| `KAFKA_ZOOKEEPER_TLS_TYPE` | Choose the TLS certificate format to use. Allowed values: `JKS`, `PEM`. | `JKS` |
202202
| `KAFKA_INTER_BROKER_USER` | Kafka inter broker communication user. | `user` |
203203
| `KAFKA_INTER_BROKER_PASSWORD` | Kafka inter broker communication password. | `bitnami` |
204204
| `KAFKA_CONTROLLER_USER` | Kafka control plane communication user. | `controller_user` |

0 commit comments

Comments
 (0)