File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22
33export MAX_READY_COUNT=${MAX_READY_COUNT:- 10000}
4- export BEARER_TOKEN=/var/run/secrets/kubernetes.io/serviceaccount/token
54export DATA_PATH=${DATA_PATH:-/ opt/ nsq/ data}
6- if [ -f $BEARER_TOKEN ]; then
7- export TOKEN=$( cat $BEARER_TOKEN )
8- export POD_API_URL=https://$KUBERNETES_SERVICE_HOST :$KUBERNETES_SERVICE_PORT /api/v1/namespaces/$POD_NAMESPACE /pods/$HOSTNAME
9- export NODE_NAME=$( curl -s $POD_API_URL --header " Authorization: Bearer $TOKEN " --insecure | grep nodeName | cut -c 18- | tr -d ' ",' )
10- echo " Set broadcast-address to ${NODE_NAME} and MAX_READY_COUNT to ${MAX_READY_COUNT} "
11- exec nsqd -broadcast-address ${NODE_NAME} -max-rdy-count ${MAX_READY_COUNT} --data-path ${DATA_PATH}
12- else
13- echo " Need a bearer token to start nsqd. Please create a service account."
14- exit 1
15- fi
5+ exec nsqd -max-rdy-count ${MAX_READY_COUNT} --data-path ${DATA_PATH}
You can’t perform that action at this time.
0 commit comments