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: ...@@ -85,8 +85,16 @@ deploy-nodeport-helm:
--values values.yaml --values values.yaml
deploy-lb-helm: 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 \ @helm install viking-ingress-lb $(CHARTDIR)/viking-test-app \
--values values-lb.yaml --values values.yaml
deploy-cafe-kubectl: deploy-cafe-kubectl:
@kubectl apply -f $(mkdir)/../hello/cafe.yaml @kubectl apply -f $(mkdir)/../hello/cafe.yaml
...@@ -113,7 +121,8 @@ undeploy-nodeport-helm: ...@@ -113,7 +121,8 @@ undeploy-nodeport-helm:
@helm uninstall viking-service-nodeport @helm uninstall viking-service-nodeport
$(MAKE) wait-delete $(MAKE) wait-delete
undeploy-loadbalancer-helm: undeploy-lb-helm:
@helm uninstall viking-service-lb
@helm uninstall viking-ingress-lb @helm uninstall viking-ingress-lb
$(MAKE) wait-delete $(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 ...@@ -6,22 +6,14 @@ source ${MYDIR}/../../test/utils.sh
IP=${IP:-127.0.0.1} IP=${IP:-127.0.0.1}
LOCALPORT=${LOCALPORT:-8888} LOCALPORT=${LOCALPORT:-8888}
# Wait for configuration by waiting for the loadBalancer IP in the svctypes=$(kubectl get pods -l app=varnish-ingress,example=svctypes)
# Ingress to be set. if [[ -n ${svctypes} ]]; then
N=0 wait_until_ready app=varnish-ingress,example=svctypes
timeout=120 wait_until_configured app=varnish-ingress,example=svctypes
while true; do else
ip=$(kubectl get ing cafe-ingress-varnish -o jsonpath='{.status.loadBalancer.ingress[0].ip}') wait_until_ready app=varnish-ingress
if [[ -n ${ip} ]]; then wait_until_configured app=varnish-ingress
break fi
fi
if [ $N -ge ${timeout} ]; then
echo "Timed out waiting for Ingress to be configured"
exit 1
fi
sleep 1
N=$(( N + 1 ))
done
NODEPORT=$(kubectl get svc svctypes-example -o jsonpath='{.spec.ports[0].nodePort}') 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}') EXTERNALIP=$(kubectl get svc svctypes-example -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
...@@ -48,9 +40,10 @@ fi ...@@ -48,9 +40,10 @@ fi
set +e set +e
N=0 N=0
timeout=120
while true; do while true; do
cat < /dev/null > /dev/tcp/${IP}/${PORT} cat < /dev/null > /dev/tcp/${IP}/${PORT}
if [ $? -eq 0 ]; then if [[ $? -eq 0 ]]; then
break break
fi fi
if [ $N -ge ${timeout} ]; then 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