Skip to content

Commit

Permalink
entrypoint.sh add default bind ip avoid apiserver grpc bind error (in…
Browse files Browse the repository at this point in the history
…dex out of range) in some case
  • Loading branch information
archfish committed Jun 10, 2019
1 parent ec30e78 commit 108bc6d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ start_etcd() {
etcd $ETCD_OPTS &
}

DEFAULT_IP="0.0.0.0"

start_apiserver() {
apiserver --addr=:9092 --addr-http=:9093 --discovery $API_SERVER_OPTS &
apiserver --addr=${DEFAULT_IP}:9092 --addr-http=${DEFAULT_IP}:9093 --discovery $API_SERVER_OPTS &
}

INPUT_CMD=$@
Expand All @@ -17,7 +19,7 @@ then
INPUT_CMD=${CMD}
fi

DEFAULT_EXEC="proxy --addr=:80 --log-level=$GATEWAY_LOG_LEVEL $GW_PROXY_OPTS"
DEFAULT_EXEC="proxy --addr=${DEFAULT_IP}:80 --log-level=$GATEWAY_LOG_LEVEL $GW_PROXY_OPTS"
if [ "${INPUT_CMD}" = 'demo' ]
then
start_etcd
Expand All @@ -34,7 +36,7 @@ fi

if [ "${INPUT_CMD}" = 'apiserver' ]
then
EXEC="apiserver --addr=:9092 --addr-http=:9093 --discovery $API_SERVER_OPTS"
EXEC="apiserver --addr=${DEFAULT_IP}:9092 --addr-http=${DEFAULT_IP}:9093 --discovery $API_SERVER_OPTS"
fi

if [ "${INPUT_CMD}" = 'etcd' ]
Expand Down

0 comments on commit 108bc6d

Please sign in to comment.