Commit 735aa9dc authored by Geoff Simmons's avatar Geoff Simmons

Add a helm version of the example/test for Service type LoadBalancer.

parent 7103cd44
......@@ -85,8 +85,16 @@ deploy-nodeport-helm:
--values values.yaml
deploy-lb-helm:
@helm install viking-service-lb $(CHARTDIR)/viking-service \
--values values-lb.yaml \
--set vikingService.secrets.admin=$(shell $(GEN_SECRET)) \
--set vikingService.secrets.dataplaneapi=$(shell $(GEN_SECRET)) \
--set vikingService.varnish.image.repository=$(VARNISH_IMAGE) \
--set vikingService.varnish.image.tag=$(VARNISH_TAG) \
--set vikingService.haproxy.image.repository=$(HAPROXY_IMAGE) \
--set vikingService.haproxy.image.tag=$(HAPROXY_TAG)
@helm install viking-ingress-lb $(CHARTDIR)/viking-test-app \
--values values-lb.yaml
--values values.yaml
deploy-cafe-kubectl:
@kubectl apply -f $(mkdir)/../hello/cafe.yaml
......@@ -113,7 +121,8 @@ undeploy-nodeport-helm:
@helm uninstall viking-service-nodeport
$(MAKE) wait-delete
undeploy-loadbalancer-helm:
undeploy-lb-helm:
@helm uninstall viking-service-lb
@helm uninstall viking-ingress-lb
$(MAKE) wait-delete
......
nameOverride: svctypes-example
fullnameOverride: svctypes-example
vikingService:
service:
type: LoadBalancer
## Name of the ingress class to route through this controller
##
ingressClass: varnish
replicaCount: 1
# labels to add to the pod container metadata
podLabels:
app: varnish-ingress
example: svctypes
......@@ -6,22 +6,14 @@ source ${MYDIR}/../../test/utils.sh
IP=${IP:-127.0.0.1}
LOCALPORT=${LOCALPORT:-8888}
# Wait for configuration by waiting for the loadBalancer IP in the
# Ingress to be set.
N=0
timeout=120
while true; do
ip=$(kubectl get ing cafe-ingress-varnish -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
if [[ -n ${ip} ]]; then
break
fi
if [ $N -ge ${timeout} ]; then
echo "Timed out waiting for Ingress to be configured"
exit 1
fi
sleep 1
N=$(( N + 1 ))
done
svctypes=$(kubectl get pods -l app=varnish-ingress,example=svctypes)
if [[ -n ${svctypes} ]]; then
wait_until_ready app=varnish-ingress,example=svctypes
wait_until_configured app=varnish-ingress,example=svctypes
else
wait_until_ready app=varnish-ingress
wait_until_configured app=varnish-ingress
fi
NODEPORT=$(kubectl get svc svctypes-example -o jsonpath='{.spec.ports[0].nodePort}')
EXTERNALIP=$(kubectl get svc svctypes-example -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
......@@ -48,9 +40,10 @@ fi
set +e
N=0
timeout=120
while true; do
cat < /dev/null > /dev/tcp/${IP}/${PORT}
if [ $? -eq 0 ]; then
if [[ $? -eq 0 ]]; then
break
fi
if [ $N -ge ${timeout} ]; then
......
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