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
20f4ac89
Commit
20f4ac89
authored
Feb 07, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automate un-/deployment & test of the Varnish Pod template examples.
parent
1629bac2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
148 additions
and
0 deletions
+148
-0
cafe_cli-args.vtc
examples/varnish_pod_template/cafe_cli-args.vtc
+1
-0
cafe_proxy.vtc
examples/varnish_pod_template/cafe_proxy.vtc
+47
-0
cli-args.yaml
examples/varnish_pod_template/cli-args.yaml
+1
-0
deploy_cli-args.sh
examples/varnish_pod_template/deploy_cli-args.sh
+7
-0
deploy_env.sh
examples/varnish_pod_template/deploy_env.sh
+7
-0
deploy_proxy.sh
examples/varnish_pod_template/deploy_proxy.sh
+7
-0
env.yaml
examples/varnish_pod_template/env.yaml
+1
-0
proxy.yaml
examples/varnish_pod_template/proxy.yaml
+1
-0
undeploy.sh
examples/varnish_pod_template/undeploy.sh
+19
-0
verify_cli-args.sh
examples/varnish_pod_template/verify_cli-args.sh
+19
-0
verify_env.sh
examples/varnish_pod_template/verify_env.sh
+19
-0
verify_proxy.sh
examples/varnish_pod_template/verify_proxy.sh
+19
-0
No files found.
examples/varnish_pod_template/cafe_cli-args.vtc
0 → 120000
View file @
20f4ac89
../hello/cafe.vtc
\ No newline at end of file
examples/varnish_pod_template/cafe_proxy.vtc
0 → 100644
View file @
20f4ac89
# looks like -*- vcl -*-
varnishtest "cafe example using PROXY"
client c1 -connect "${localhost} ${localport}" -proxy1 "1.2.3.4:1234 5.6.7.8:5678" {
txreq -url /coffee/foo/bar -hdr "Host: cafe.example.com"
rxresp
expect resp.status == 200
expect resp.body ~ "(?m)^URI: /coffee/foo/bar$"
expect resp.body ~ "(?m)^Server name: coffee-[a-z0-9]+-[a-z0-9]+$"
txreq -url /tea/baz/quux -hdr "Host: cafe.example.com"
rxresp
expect resp.status == 200
expect resp.body ~ "(?m)^URI: /tea/baz/quux$"
expect resp.body ~ "(?m)^Server name: tea-[a-z0-9]+-[a-z0-9]+$"
txreq -url /coffee/foo/bar
rxresp
expect resp.status == 404
txreq -url /milk -hdr "Host: cafe.example.com"
rxresp
expect resp.status == 404
} -run
client c1 -connect "${localhost} ${localport}" -proxy2 "1.2.3.4:1234 5.6.7.8:5678" {
txreq -url /coffee/foo/bar -hdr "Host: cafe.example.com"
rxresp
expect resp.status == 200
expect resp.body ~ "(?m)^URI: /coffee/foo/bar$"
expect resp.body ~ "(?m)^Server name: coffee-[a-z0-9]+-[a-z0-9]+$"
txreq -url /tea/baz/quux -hdr "Host: cafe.example.com"
rxresp
expect resp.status == 200
expect resp.body ~ "(?m)^URI: /tea/baz/quux$"
expect resp.body ~ "(?m)^Server name: tea-[a-z0-9]+-[a-z0-9]+$"
txreq -url /coffee/foo/bar
rxresp
expect resp.status == 404
txreq -url /milk -hdr "Host: cafe.example.com"
rxresp
expect resp.status == 404
} -run
examples/varnish_pod_template/cli-args.yaml
View file @
20f4ac89
...
...
@@ -11,6 +11,7 @@ spec:
metadata
:
labels
:
app
:
varnish-ingress
example
:
cli-args
spec
:
containers
:
-
image
:
varnish-ingress/varnish
...
...
examples/varnish_pod_template/deploy_cli-args.sh
0 → 100755
View file @
20f4ac89
#! /bin/bash -ex
kubectl apply
-f
../hello/cafe.yaml
kubectl apply
-f
../hello/cafe-ingress.yaml
kubectl apply
-f
cli-args.yaml
examples/varnish_pod_template/deploy_env.sh
0 → 100755
View file @
20f4ac89
#! /bin/bash -ex
kubectl apply
-f
../hello/cafe.yaml
kubectl apply
-f
../hello/cafe-ingress.yaml
kubectl apply
-f
env.yaml
examples/varnish_pod_template/deploy_proxy.sh
0 → 100755
View file @
20f4ac89
#! /bin/bash -ex
kubectl apply
-f
../hello/cafe.yaml
kubectl apply
-f
../hello/cafe-ingress.yaml
kubectl apply
-f
proxy.yaml
examples/varnish_pod_template/env.yaml
View file @
20f4ac89
...
...
@@ -11,6 +11,7 @@ spec:
metadata
:
labels
:
app
:
varnish-ingress
example
:
env
spec
:
containers
:
-
image
:
varnish-ingress/varnish
...
...
examples/varnish_pod_template/proxy.yaml
View file @
20f4ac89
...
...
@@ -11,6 +11,7 @@ spec:
metadata
:
labels
:
app
:
varnish-ingress
example
:
proxy
spec
:
containers
:
-
image
:
varnish-ingress/varnish
...
...
examples/varnish_pod_template/undeploy.sh
0 → 100755
View file @
20f4ac89
#! /bin/bash -ex
kubectl delete svc varnish-ingress
kubectl delete deploy varnish
echo
Waiting
until
example varnish-ingress Pods are deleted
kubectl
wait
--timeout
=
2m pod
-l
app
=
varnish-ingress
--for
=
delete
kubectl delete
-f
../hello/cafe-ingress.yaml
kubectl delete
-f
../hello/cafe.yaml
kubectl apply
-f
../../deploy/varnish.yaml
kubectl apply
-f
../../deploy/nodeport.yaml
echo
Waiting
until
varnish-ingress Pods are running
kubectl
wait
--timeout
=
2m pod
-l
app
=
varnish-ingress
--for
=
condition
=
Initialized
examples/varnish_pod_template/verify_cli-args.sh
0 → 100755
View file @
20f4ac89
#! /bin/bash -x
function
killforward
{
kill
$KUBEPID
}
LOCALPORT
=
${
LOCALPORT
:-
8888
}
kubectl
wait
--timeout
=
2m pod
-l
app
=
varnish-ingress,example!
=
cli-args
--for
=
delete
set
-e
kubectl
wait
--timeout
=
2m pod
-l
example
=
cli-args
--for
=
condition
=
Ready
kubectl port-forward svc/varnish-ingress
${
LOCALPORT
}
:80
>
/dev/null &
KUBEPID
=
$!
trap
killforward EXIT
sleep
1
varnishtest
${
TESTOPTS
}
-Dlocalport
=
${
LOCALPORT
}
cafe_cli-args.vtc
examples/varnish_pod_template/verify_env.sh
0 → 100755
View file @
20f4ac89
#! /bin/bash -x
function
killforward
{
kill
$KUBEPID
}
LOCALPORT
=
${
LOCALPORT
:-
8888
}
kubectl
wait
--timeout
=
2m pod
-l
app
=
varnish-ingress,example!
=
env
--for
=
delete
set
-e
kubectl
wait
--timeout
=
2m pod
-l
example
=
env
--for
=
condition
=
Ready
kubectl port-forward svc/varnish-ingress
${
LOCALPORT
}
:81
>
/dev/null &
KUBEPID
=
$!
trap
killforward EXIT
sleep
1
varnishtest
${
TESTOPTS
}
-Dlocalport
=
${
LOCALPORT
}
cafe_proxy.vtc
examples/varnish_pod_template/verify_proxy.sh
0 → 100755
View file @
20f4ac89
#! /bin/bash -x
function
killforward
{
kill
$KUBEPID
}
LOCALPORT
=
${
LOCALPORT
:-
8888
}
kubectl
wait
--timeout
=
2m pod
-l
app
=
varnish-ingress,example!
=
proxy
--for
=
delete
set
-e
kubectl
wait
--timeout
=
2m pod
-l
example
=
proxy
--for
=
condition
=
Ready
kubectl port-forward svc/varnish-ingress
${
LOCALPORT
}
:80
>
/dev/null &
KUBEPID
=
$!
trap
killforward EXIT
sleep
1
varnishtest
${
TESTOPTS
}
-Dlocalport
=
${
LOCALPORT
}
cafe_proxy.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