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
fd5f3373
Commit
fd5f3373
authored
Feb 07, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automate un-/deployment & test of multi-Ingress in ns example.
parent
36e6de41
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
0 deletions
+108
-0
cafe.vtc
examples/architectures/multi-varnish-ns/cafe.vtc
+25
-0
deploy.sh
examples/architectures/multi-varnish-ns/deploy.sh
+23
-0
undeploy.sh
examples/architectures/multi-varnish-ns/undeploy.sh
+23
-0
verify.sh
examples/architectures/multi-varnish-ns/verify.sh
+37
-0
No files found.
examples/architectures/multi-varnish-ns/cafe.vtc
0 → 100644
View file @
fd5f3373
# looks like -*- vcl -*-
varnishtest "cafe example, multiple Varnish Services in a namespace"
client c1 -connect "${localhost} ${coffeeport}" {
txreq -url /foo -hdr "Host: coffee.example.com"
rxresp
expect resp.status == 200
expect resp.body ~ "(?m)^Server name: coffee-[a-z0-9]+-[a-z0-9]+$"
txreq -url /foo -hdr "Host: tea.example.com"
rxresp
expect resp.status == 404
} -run
client c1 -connect "${localhost} ${teaport}" {
txreq -url /bar -hdr "Host: tea.example.com"
rxresp
expect resp.status == 200
expect resp.body ~ "(?m)^Server name: tea-[a-z0-9]+-[a-z0-9]+$"
txreq -url /foo -hdr "Host: coffee.example.com"
rxresp
expect resp.status == 404
} -run
examples/architectures/multi-varnish-ns/deploy.sh
0 → 100755
View file @
fd5f3373
#! /bin/bash -ex
kubectl apply
-f
namespace.yaml
kubectl apply
-f
coffee.yaml
kubectl apply
-f
tea.yaml
kubectl apply
-f
adm-secret-tea.yaml
kubectl apply
-f
nodeport-tea.yaml
kubectl apply
-f
varnish-tea.yaml
kubectl apply
-f
adm-secret-coffee.yaml
kubectl apply
-f
nodeport-coffee.yaml
kubectl apply
-f
varnish-coffee.yaml
kubectl apply
-f
coffee-ingress.yaml
kubectl apply
-f
tea-ingress.yaml
examples/architectures/multi-varnish-ns/undeploy.sh
0 → 100755
View file @
fd5f3373
#! /bin/bash -ex
kubectl delete
-f
tea-ingress.yaml
kubectl delete
-f
coffee-ingress.yaml
kubectl delete
-f
varnish-coffee.yaml
kubectl delete
-f
nodeport-coffee.yaml
kubectl delete
-f
adm-secret-coffee.yaml
kubectl delete
-f
varnish-tea.yaml
kubectl delete
-f
nodeport-tea.yaml
kubectl delete
-f
adm-secret-tea.yaml
kubectl delete
-f
tea.yaml
kubectl delete
-f
coffee.yaml
kubectl delete
-f
namespace.yaml
examples/architectures/multi-varnish-ns/verify.sh
0 → 100755
View file @
fd5f3373
#! /bin/bash -ex
function
killcoffee
{
kill
$COFFEEPID
}
function
killcafe
{
kill
$COFFEEPID
kill
$TEAPID
}
COFFEEPORT
=
${
COFFEEPORT
:-
8888
}
TEAPORT
=
${
TEAPORT
:-
9999
}
kubectl
wait
-n
cafe
--timeout
=
2m pod
-l
app
=
varnish-ingress
--for
=
condition
=
Ready
kubectl port-forward
-n
cafe svc/varnish-coffee
${
COFFEEPORT
}
:80
>
/dev/null &
COFFEEPID
=
$!
trap
killcoffee EXIT
kubectl port-forward
-n
cafe svc/varnish-tea
${
TEAPORT
}
:80
>
/dev/null &
TEAPID
=
$!
trap
killcafe EXIT
sleep
1
varnishtest
${
TESTOPTS
}
-Dcoffeeport
=
${
COFFEEPORT
}
-Dteaport
=
${
TEAPORT
}
cafe.vtc
# Parse the controller log for these lines
# Ingresses implemented by Varnish Service cafe/varnish-tea: [cafe/tea-ingress]
# Ingresses implemented by Varnish Service cafe/varnish-coffee: [cafe/coffee-ingress]
# Get the name of the controller Pod
CTLPOD
=
$(
kubectl get pods
-n
kube-system
-l
app
=
varnish-ingress-controller
-o
jsonpath
={
.items[0].metadata.name
}
)
# Match the logs
kubectl logs
-n
kube-system
$CTLPOD
|
grep
-q
'Ingresses implemented by Varnish Service cafe/varnish-coffee: \[cafe/coffee-ingress\]'
kubectl logs
-n
kube-system
$CTLPOD
|
grep
-q
'Ingresses implemented by Varnish Service cafe/varnish-tea: \[cafe/tea-ingress\]'
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