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

Improve tagging & deployment for install-contour/provisioner-working scripts #5854

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
13 changes: 7 additions & 6 deletions test/scripts/install-contour-working.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ if ! kind::cluster::exists "$CLUSTERNAME" ; then
exit 2
fi

# Set (pseudo) random image tag to trigger restarts at every deployment.
# TODO: Come up with a scheme that doesn't fill up the dev environment with randomly-tagged images.
VERSION="v$$"
docker rmi ghcr.io/projectcontour/contour:dev --force

# Build the image.
make -C ${REPO} container IMAGE=ghcr.io/projectcontour/contour VERSION=${VERSION}
make -C ${REPO} container IMAGE=ghcr.io/projectcontour/contour VERSION=dev

# Push the Contour build image into the cluster.
kind::cluster::load::docker ghcr.io/projectcontour/contour:${VERSION}
kind::cluster::load::docker ghcr.io/projectcontour/contour:dev

# Install Contour
${KUBECTL} apply -f ${REPO}/examples/contour/00-common.yaml
Expand All @@ -71,11 +69,14 @@ for file in ${REPO}/examples/contour/02-job-certgen.yaml ${REPO}/examples/contou
# we built above.
sed \
"-es|imagePullPolicy: Always|imagePullPolicy: IfNotPresent|" \
"-es|image: ghcr.io/projectcontour/contour:.*$|image: ghcr.io/projectcontour/contour:${VERSION}|" \
"-es|image: ghcr.io/projectcontour/contour:.*$|image: ghcr.io/projectcontour/contour:dev|" \
"$file" | \
${KUBECTL} apply -f -
done

# Patching the deployment with timestamp will trigger pod restart.
${KUBECTL} patch deployment -n projectcontour contour --patch '{"spec": {"template": {"metadata": {"annotations": {"timestamp": "'$(date +%s)'"}}}}}'
harshil1973 marked this conversation as resolved.
Show resolved Hide resolved

# Wait for Contour and Envoy to report "Ready" status.
${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l app=contour deployments --for=condition=Available
${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l app=envoy pods --for=condition=Ready
5 changes: 5 additions & 0 deletions test/scripts/install-provisioner-working.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ ${KUBECTL} apply -f <(cat examples/gateway-provisioner/03-gateway-provisioner.ya
yq eval '.spec.template.spec.containers[0].imagePullPolicy = "IfNotPresent"' - | \
yq eval '.spec.template.spec.containers[0].args += "--contour-image="+env(CONTOUR_IMG)' -)

# Patching the deployment with timestamp will trigger pod restart.
for deployment in $(kubectl get deployment -n projectcontour -l app.kubernetes.io/managed-by=contour-gateway-provisioner -o name) ; do
${KUBECTL} patch $deployment -n projectcontour --patch '{"spec": {"template": {"metadata": {"annotations": {"timestamp": "'$(date +%s)'"}}}}}'
done

# Wait for the provisioner to report "Ready" status.
${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l control-plane=contour-gateway-provisioner deployments --for=condition=Available
${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l control-plane=contour-gateway-provisioner pods --for=condition=Ready