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
18c6a221
Commit
18c6a221
authored
Feb 07, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automate un-/deployment & test of the cluster-wide Ingress example.
parent
20f4ac89
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
0 deletions
+105
-0
cafe.vtc
examples/architectures/clusterwide/cafe.vtc
+20
-0
deploy.sh
examples/architectures/clusterwide/deploy.sh
+27
-0
undeploy.sh
examples/architectures/clusterwide/undeploy.sh
+27
-0
verify.sh
examples/architectures/clusterwide/verify.sh
+31
-0
No files found.
examples/architectures/clusterwide/cafe.vtc
0 → 100644
View file @
18c6a221
# looks like -*- vcl -*-
varnishtest "cafe example in separate namespaces"
client c1 -connect "${localhost} ${localport}" {
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 /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 /baz -hdr "Host: anything.else"
rxresp
expect resp.status == 200
expect resp.body ~ "(?m)^Server name: other-[a-z0-9]+-[a-z0-9]+$"
} -run
examples/architectures/clusterwide/deploy.sh
0 → 100755
View file @
18c6a221
#! /bin/bash -ex
# Delete the Varnish Service in namespace default.
# Otherwise the Service in kube-system is not unique in the cluster,
# and a Service for the Ingresses in the other namespaces cannot be
# determined.
kubectl delete
-f
../../../deploy/nodeport.yaml
kubectl apply
-f
namespace.yaml
kubectl apply
-f
coffee.yaml
kubectl apply
-f
tea.yaml
kubectl apply
-f
other.yaml
kubectl apply
-f
adm-secret.yaml
kubectl apply
-f
nodeport.yaml
kubectl apply
-f
varnish.yaml
kubectl apply
-f
coffee-ingress.yaml
kubectl apply
-f
tea-ingress.yaml
kubectl apply
-f
other-ingress.yaml
examples/architectures/clusterwide/undeploy.sh
0 → 100755
View file @
18c6a221
#! /bin/bash -ex
kubectl delete
-f
other-ingress.yaml
kubectl delete
-f
tea-ingress.yaml
kubectl delete
-f
coffee-ingress.yaml
kubectl delete
-f
varnish.yaml
kubectl delete
-f
nodeport.yaml
kubectl delete
-f
adm-secret.yaml
kubectl delete
-f
other.yaml
kubectl delete
-f
tea.yaml
kubectl delete
-f
coffee.yaml
kubectl delete
-f
namespace.yaml
# Restores the Varnish Service in namespace default.
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/architectures/clusterwide/verify.sh
0 → 100755
View file @
18c6a221
#! /bin/bash -ex
function
killforward
{
kill
$KUBEPID
}
LOCALPORT
=
${
LOCALPORT
:-
8888
}
kubectl
wait
-n
kube-system
--timeout
=
2m pod
-l
app
=
varnish-ingress
\
--for
=
condition
=
Ready
kubectl port-forward
-n
kube-system svc/varnish-ingress
${
LOCALPORT
}
:80
>
/dev/null &
KUBEPID
=
$!
trap
killforward EXIT
sleep
1
varnishtest
${
TESTOPTS
}
-Dlocalport
=
${
LOCALPORT
}
cafe.vtc
# Parse the controller log for this line (Ingress names in any order):
# Ingresses implemented by Varnish Service kube-system/varnish-ingress: [coffee/coffee-ingress tea/tea-ingress other/other-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
}
)
# Extract the last matching line
INGS
=
$(
kubectl logs
-n
kube-system
$CTLPOD
|
grep
'Ingresses implemented by Varnish Service kube-system/varnish-ingress'
|
tail
-1
)
# Check that line for the three Ingress names
echo
$INGS
|
grep
'coffee/coffee-ingress'
echo
$INGS
|
grep
'tea/tea-ingress'
echo
$INGS
|
grep
'other/other-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