Commit 6e7fc630 authored by Geoff Simmons's avatar Geoff Simmons

Update (or workaround) the example for self-sharding.

The verification script intermittently gets a 503 status if requests
are sent to "soon", even after waiting for the Varnish Services to
become ready. It doesn't appear to happen if we wait a few seconds
longer.

For now, wait longer until we run the verification test case. In the
long run, we should investigate why the configuration is not actually
ready when the Ready state is reached.
parent 694ed696
......@@ -9,7 +9,7 @@ spec:
# Lists the Service names of Varnish services in the same namespace
# to which this config is to be applied.
services:
- varnish-ingress
- varnish-ingress-admin
# If the self-sharding object is present, then self-sharding will be
# implemented for the named service. All of its properties are
......
......@@ -7,11 +7,12 @@ kubectl delete -f ../hello/cafe-ingress.yaml
kubectl delete -f ../hello/cafe.yaml
echo "Waiting until varnish-ingress Pods are not ready"
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'
N=0
until [ $N -ge 120 ]
do
if kubectl get pods -l app=varnish-ingress | grep -q ' 1/1'; then
if kubectl get pods -l app=varnish-ingress -o jsonpath="${JSONPATH}" | grep -q '\bReady=True\b'; then
sleep 10
N=$(( N + 10 ))
continue
......
../hello/verify.sh
\ No newline at end of file
#! /bin/bash -ex
# Nothing special about self-sharding is verified here, just run the
# same tests as for the cafe example ("hello").
function killforward {
kill $KUBEPID
}
LOCALPORT=${LOCALPORT:-8888}
kubectl wait --timeout=2m pod -l app=varnish-ingress --for=condition=Ready
kubectl port-forward svc/varnish-ingress ${LOCALPORT}:80 >/dev/null &
KUBEPID=$!
trap killforward EXIT
# XXX hackish
# If we run the test too "soon" after the Varnish Services become ready,
# the client may received a 503 response. It doesn't appear to happen if
# we wait a few seconds longer.
# For now, wait longer to run the verification. Should investigate why
# Varnish is not properly configured immediately after self-sharding is
# deployed.
sleep 10
#sleep 1
varnishtest ${TESTOPTS} -Dlocalport=${LOCALPORT} cafe.vtc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment