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 1111 export KAFKA_BROKER_ID=${HOSTNAME##*-}
1212 sed -i "s/\${KAFKA_BROKER_ID}/$KAFKA_BROKER_ID/" /etc/kafka/server.properties
1313
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+
1427 server.properties : |-
1528 # Licensed to the Apache Software Foundation (ASF) under one or more
1629 # contributor license agreements. See the NOTICE file distributed with
You can’t perform that action at this time.
0 commit comments