Skip to content

Commit

Permalink
Add option to use existing images (#4435)
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored Aug 13, 2019
1 parent 0fb77ae commit d406c96
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions build/run-ingress-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ declare -a mandatory
mandatory=(
IMAGE
ARCH
TAG
)

missing=false
Expand All @@ -56,21 +57,27 @@ trap cleanup EXIT

KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..

# the ingress controller needs this two variables. To avoid the
# the ingress controller needs this two variables. To avoid the
# creation of any object in the cluster we use invalid names.
POD_NAMESPACE="invalid-namespace"
POD_NAME="invalid-namespace"

export TAG=local
export TAG
export IMAGE

if [[ "${ARCH}" != "amd64" ]]; then
echo -e "${BGREEN}Register ${RED}/usr/bin/qemu-ARCH-static${BGREEN} as the handler for binaries in multiple platforms${NC}"
make -C "${KUBE_ROOT}" register-qemu
fi

echo -e "${BGREEN}Building ingress controller image${NC}"
make -C "${KUBE_ROOT}" build "sub-container-${ARCH}"
USE_EXISTING_IMAGE=${USE_EXISTING_IMAGE:-false}
if [[ "${USE_EXISTING_IMAGE}" == "true" ]]; then
echo -e "${BGREEN}Downloading ingress controller image${NC}"
docker pull "${IMAGE}-${ARCH}:${TAG}"
else
echo -e "${BGREEN}Building ingress controller image${NC}"
make -C "${KUBE_ROOT}" build "sub-container-${ARCH}"
fi

CONTEXT=$(kubectl config current-context)

Expand Down Expand Up @@ -103,7 +110,7 @@ docker run \
-v "${SSL_VOLUME}:/etc/ingress-controller/ssl/" \
-v "${HOME}/.kube:${HOME}/.kube:ro" \
${MINIKUBE_VOLUME} \
"${IMAGE}:${TAG}" /nginx-ingress-controller \
"${IMAGE}-${ARCH}:${TAG}" /nginx-ingress-controller \
--update-status=false \
--v=2 \
--apiserver-host=http://0.0.0.0:8001 \
Expand Down

0 comments on commit d406c96

Please sign in to comment.