Skip to content

Commit

Permalink
Merge pull request #6 from jmccarty3/remove_node_address
Browse files Browse the repository at this point in the history
Removing unneeded node address information.
  • Loading branch information
Matthew Fisher authored Oct 3, 2016
2 parents 68cc177 + f675e23 commit 023ecf4
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions rootfs/opt/nsq/bin/start-nsqd
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,5 @@
set -eo pipefail

export MAX_READY_COUNT=${MAX_READY_COUNT:-10000}
export BEARER_TOKEN=/var/run/secrets/kubernetes.io/serviceaccount/token
export DATA_PATH=${DATA_PATH:-/opt/nsq/data}
if [ -f $BEARER_TOKEN ]; then
export TOKEN=$(cat $BEARER_TOKEN)
export POD_API_URL=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api/v1/namespaces/$POD_NAMESPACE/pods/$HOSTNAME
export NODE_NAME=$(curl -s $POD_API_URL --header "Authorization: Bearer $TOKEN" --insecure | grep nodeName | cut -c 18- | tr -d '",')
echo "Set broadcast-address to ${NODE_NAME} and MAX_READY_COUNT to ${MAX_READY_COUNT}"
exec nsqd -broadcast-address ${NODE_NAME} -max-rdy-count ${MAX_READY_COUNT} --data-path ${DATA_PATH}
else
echo "Need a bearer token to start nsqd. Please create a service account."
exit 1
fi
exec nsqd -max-rdy-count ${MAX_READY_COUNT} --data-path ${DATA_PATH}

0 comments on commit 023ecf4

Please sign in to comment.