Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
afcea800
Commit
afcea800
authored
Feb 07, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automate un-/deployment & test of the custom VCL example.
parent
ded4b7fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
0 deletions
+57
-0
cafe.vtc
examples/custom-vcl/cafe.vtc
+12
-0
deploy.sh
examples/custom-vcl/deploy.sh
+7
-0
undeploy.sh
examples/custom-vcl/undeploy.sh
+22
-0
verify.sh
examples/custom-vcl/verify.sh
+16
-0
No files found.
examples/custom-vcl/cafe.vtc
0 → 100644
View file @
afcea800
# looks like -*- vcl -*-
varnishtest "cafe example, custom VCL"
client c1 -connect "${localhost} ${localport}" {
txreq -url /coffee -hdr "Host: cafe.example.com"
rxresp
expect resp.status == 200
expect resp.http.Backend ~ {^vk8s_default_2f_coffee-svc_\d+_\d+_\d+_\d+$}
expect resp.http.Hello == "world"
expect resp.body ~ "(?m)^Server name: coffee-[a-z0-9]+-[a-z0-9]+$"
} -run
examples/custom-vcl/deploy.sh
0 → 100755
View file @
afcea800
#! /bin/bash -ex
kubectl apply
-f
../hello/cafe.yaml
kubectl apply
-f
../hello/cafe-ingress.yaml
kubectl apply
-f
custom-vcl.yaml
examples/custom-vcl/undeploy.sh
0 → 100755
View file @
afcea800
#! /bin/bash -ex
kubectl delete
-f
custom-vcl.yaml
kubectl delete
-f
../hello/cafe-ingress.yaml
kubectl delete
-f
../hello/cafe.yaml
echo
"Waiting until varnish-ingress Pods are not ready"
N
=
0
until
[
$N
-ge
120
]
do
if
kubectl get pods
-l
app
=
varnish-ingress |
grep
-q
' 1/1'
;
then
sleep
10
N
=
$((
N
+
10
))
continue
fi
exit
0
done
echo
"Giving up"
exit
1
examples/custom-vcl/verify.sh
0 → 100755
View file @
afcea800
#! /bin/bash -ex
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
sleep
1
varnishtest
${
TESTOPTS
}
-Dlocalport
=
${
LOCALPORT
}
cafe.vtc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment