Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for etcd to startup before trying to connect to it #337

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apiserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FROM debian:buster

# Install runtime dependencies
RUN apt-get -qq update && \
apt-get -qq install --no-install-recommends binutils git ca-certificates netcat && \
apt-get -qq install --no-install-recommends binutils git ca-certificates netcat curl && \
apt-get -qq autoremove && \
apt-get -qq autoclean && \
apt-get -qq clean all && \
Expand Down
11 changes: 10 additions & 1 deletion apiserver/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ cat << EOF > /apiserver.json
}
EOF


# Wait for etcd to come online
echo -n "Waiting for etcd at $ETCD_ADDR..."
until $(curl -XGET --output /dev/null --silent --fail ${ETCD_ADDR}/version); do
echo -n "."
sleep 3
done
echo -e "\netcd is online: $ETCD_ADDR"

if [ -z "$SPEC_GIT_REPO" ]; then
SPEC_GIT_REPO=https://github.com/nds-org/ndslabs-specs
fi
Expand All @@ -185,7 +194,7 @@ EOF
umask 0

if [ -z "$TEST" ]; then
apiserver -conf /apiserver.json --logtostderr=true -v=1 -passwd $ADMIN_PASSWORD
apiserver -conf /apiserver.json --logtostderr=true -v=4 -passwd $ADMIN_PASSWORD
else
echo "Running binary with test/coverage instrumentation"
echo "Writing output to $VOLUME_PATH/coverage.out"
Expand Down