Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 210e79d

Browse files
committed
Simplify skipping create Kafka topics when needed
1 parent 670d07a commit 210e79d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mqtt.kafka.broker/k8s/helm/setup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ helm upgrade --install zilla $ZILLA_CHART --namespace $NAMESPACE --create-namesp
1818
--set-file secrets.tls.data.localhost\\.p12=../../tls/localhost.p12
1919

2020
# Create the mqtt topics in Kafka
21+
if [[ "$KAFKA_SKIP_CREATE_TOPICS" != "yes" ]]; then
2122
kubectl run kafka-init-pod --image=bitnami/kafka:3.2 --namespace $NAMESPACE --rm --restart=Never -i -t -- /bin/sh -c "
2223
echo 'Creating topics for $KAFKA_HOST:$KAFKA_PORT'
2324
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server $KAFKA_HOST:$KAFKA_PORT --create --if-not-exists --topic mqtt-messages
@@ -26,6 +27,7 @@ echo 'Creating topics for $KAFKA_HOST:$KAFKA_PORT'
2627
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server $KAFKA_HOST:$KAFKA_PORT --create --if-not-exists --topic mqtt-sessions --config cleanup.policy=compact
2728
"
2829
kubectl wait --namespace $NAMESPACE --for=delete pod/kafka-init-pod
30+
fi
2931

3032
# Start port forwarding
3133
SERVICE_PORTS=$(kubectl get svc --namespace $NAMESPACE zilla --template "{{ range .spec.ports }}{{.port}} {{ end }}")

0 commit comments

Comments
 (0)