File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 12
12
sed -i "s/#init#broker.id=#init#/broker.id=$KAFKA_BROKER_ID/" /etc/kafka/server.properties
13
13
14
14
LABELS="kafka-broker-id=$KAFKA_BROKER_ID"
15
+ ANNOTATIONS=""
15
16
16
17
hash kubectl 2>/dev/null || {
17
18
sed -i "s/#init#broker.rack=#init#/#init#broker.rack=# kubectl not found in path/" /etc/kafka/server.properties
@@ -32,12 +33,15 @@ data:
32
33
else
33
34
OUTSIDE_PORT=3240${KAFKA_BROKER_ID}
34
35
sed -i "s|#init#advertised.listeners=OUTSIDE://#init#|advertised.listeners=OUTSIDE://${OUTSIDE_HOST}:${OUTSIDE_PORT}|" /etc/kafka/server.properties
35
- LABELS ="$LABELS kafka-listener-outside-host=$OUTSIDE_HOST kafka-listener-outside-port=$OUTSIDE_PORT"
36
+ ANNOTATIONS ="$ANNOTATIONS kafka-listener-outside-host=$OUTSIDE_HOST kafka-listener-outside-port=$OUTSIDE_PORT"
36
37
fi
37
38
38
39
if [ ! -z "$LABELS" ]; then
39
40
kubectl -n $POD_NAMESPACE label pod $POD_NAME $LABELS || echo "Failed to label $POD_NAMESPACE.$POD_NAME - RBAC issue?"
40
41
fi
42
+ if [ ! -z "$ANNOTATIONS" ]; then
43
+ kubectl -n $POD_NAMESPACE annotate pod $POD_NAME $ANNOTATIONS || echo "Failed to annotate $POD_NAMESPACE.$POD_NAME - RBAC issue?"
44
+ fi
41
45
}
42
46
43
47
server.properties : |-
You can’t perform that action at this time.
0 commit comments