File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11
11
export KAFKA_BROKER_ID=${HOSTNAME##*-}
12
12
sed -i "s/\${KAFKA_BROKER_ID}/$KAFKA_BROKER_ID/" /etc/kafka/server.properties
13
13
14
+ PODNAME=$HOSTNAME
15
+ NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)
16
+
17
+ # todo add curl to kafka image, switch to a curl image for init or write the whole lookup in java
18
+ hash curl 2>/dev/null || { apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install curl -y --no-install-recommends; }
19
+
20
+ API=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api
21
+ AUTH="--cacert /run/secrets/kubernetes.io/serviceaccount/ca.crt --header \"Authorization: Bearer $(cat /run/secrets/kubernetes.io/serviceaccount/token)\""
22
+
23
+ curl -s $AUTH $API/namespaces/kafka/pods/$PODNAME -I --fail-early || {
24
+ echo "Access problems. Could be RBAC."
25
+ }
26
+
14
27
server.properties : |-
15
28
# Licensed to the Apache Software Foundation (ASF) under one or more
16
29
# contributor license agreements. See the NOTICE file distributed with
You can’t perform that action at this time.
0 commit comments