Skip to content

Commit b8f876f

Browse files
committed
Clarifies the ADVERTISE_ADDR idea
1 parent 1758ba0 commit b8f876f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kafka/10broker-config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ data:
1414
LABELS="kafka-broker-id=$KAFKA_BROKER_ID"
1515
ANNOTATIONS=""
1616
17-
[ -z "$ADVERTISE_ADDR" ] && echo "ADVERTISE_ADDR is empty, will advertise detected DNS name"
17+
# A custom ADVERTISE_ADDR can be set as env on the init container using for example value: $(POD_NAME).kafka.$(POD_NAMESPACE).custom.cluster.dns
18+
[ -n "$ADVERTISE_ADDR" ] && echo "ADVERTISE_ADDR=$ADVERTISE_ADDR" || echo "ADVERTISE_ADDR is empty, Kafka will detect a hostname to advertise"
19+
1820
OUTSIDE_HOST=$(kubectl get node "$NODE_NAME" -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}')
1921
OUTSIDE_PORT=$((32400 + ${KAFKA_BROKER_ID}))
2022
SEDS+=("s|#init#advertised.listeners=PLAINTEXT://#init#|advertised.listeners=PLAINTEXT://${ADVERTISE_ADDR}:9092,CONTROLLER://${ADVERTISE_ADDR}:9093,OUTSIDE://${OUTSIDE_HOST}:${OUTSIDE_PORT}|")

0 commit comments

Comments
 (0)