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
7103cd44
Commit
7103cd44
authored
Nov 26, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a helm version of the example/test for Service type NodePort.
parent
c43e20e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
120 additions
and
7 deletions
+120
-7
Makefile
examples/svctypes/Makefile
+53
-4
values-nodeport.yaml
examples/svctypes/values-nodeport.yaml
+16
-0
values.yaml
examples/svctypes/values.yaml
+19
-0
verify.sh
examples/svctypes/verify.sh
+32
-3
No files found.
examples/svctypes/Makefile
View file @
7103cd44
...
@@ -32,11 +32,57 @@ mkdir := $(dir $(mkpath))
...
@@ -32,11 +32,57 @@ mkdir := $(dir $(mkpath))
TESTDIR
=
$(mkdir)
/../../test
TESTDIR
=
$(mkdir)
/../../test
CHARTDIR
=
$(mkdir)
/../../charts
CHARTDIR
=
$(mkdir)
/../../charts
GEN_SECRET
=
head
-c32
/dev/urandom |
base64
|
tr
+/
-_
# For the klarlack image: make VARNISH=klarlack ...
ifndef
VARNISH
VARNISH
=
varnish
endif
CI_REPO_PFX
=
registry.gitlab.com/uplex/varnish/k8s-ingress/varnish-ingress
# For tests using the local docker registry: make TEST=local ...
# For tests using images from the CI pipeline: make TEST=ci ...
ifeq
($(TEST),local)
VARNISH_IMAGE
=
varnish-ingress/
$(VARNISH)
VARNISH_TAG
=
latest
HAPROXY_IMAGE
=
varnish-ingress/haproxy
HAPROXY_TAG
=
latest
else
ifeq
($(TEST),ci)
VARNISH_IMAGE
=
$(CI_REPO_PFX)
/
$(VARNISH)
VARNISH_TAG
=
master
HAPROXY_IMAGE
=
$(CI_REPO_PFX)
/haproxy
HAPROXY_TAG
=
master
endif
# If not specified, pull the latest "official" images from dockerhub.
LATEST
=
0.1.0
ifndef
VARNISH_IMAGE
VARNISH_IMAGE
=
uplex/viking-
$(VARNISH)
endif
ifndef
VARNISH_TAG
VARNISH_TAG
=
$(LATEST)
endif
ifndef
HAPROXY_IMAGE
HAPROXY_IMAGE
=
uplex/viking-haproxy
endif
ifndef
HAPROXY_TAG
HAPROXY_TAG
=
$(LATEST)
endif
all
:
deploy
all
:
deploy
deploy-nodeport-helm
:
deploy-nodeport-helm
:
@
helm
install
viking-service-nodeport
$(CHARTDIR)
/viking-service
\
--values
values-nodeport.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-nodeport
$(CHARTDIR)
/viking-test-app
\
@
helm
install
viking-ingress-nodeport
$(CHARTDIR)
/viking-test-app
\
--values
values
-nodeport
.yaml
--values
values.yaml
deploy-lb-helm
:
deploy-lb-helm
:
@
helm
install
viking-ingress-lb
$(CHARTDIR)
/viking-test-app
\
@
helm
install
viking-ingress-lb
$(CHARTDIR)
/viking-test-app
\
...
@@ -57,16 +103,19 @@ verify:
...
@@ -57,16 +103,19 @@ verify:
$(mkdir)
/verify.sh
$(mkdir)
/verify.sh
wait
:
wait
:
@
echo
Waiting
until
varnish-ingress Pods are not configured
for
Ingress
$(TESTDIR)
/wait.sh
app
=
varnish-ingress
$(TESTDIR)
/wait.sh
app
=
varnish-ingress
wait-delete
:
$(TESTDIR)
/wait_delete.sh
app
=
varnish-ingress,example
=
svctypes
undeploy-nodeport-helm
:
undeploy-nodeport-helm
:
@
helm uninstall viking-ingress-nodeport
@
helm uninstall viking-ingress-nodeport
$(MAKE)
wait
@
helm uninstall viking-service-nodeport
$(MAKE)
wait-delete
undeploy-loadbalancer-helm
:
undeploy-loadbalancer-helm
:
@
helm uninstall viking-ingress-lb
@
helm uninstall viking-ingress-lb
$(MAKE)
wait
$(MAKE)
wait
-delete
undeploy-cafe-kubectl
:
undeploy-cafe-kubectl
:
@
kubectl delete
-f
$(mkdir)
/../hello/cafe-ingress.yaml
@
kubectl delete
-f
$(mkdir)
/../hello/cafe-ingress.yaml
...
...
examples/svctypes/values-nodeport.yaml
0 → 100644
View file @
7103cd44
nameOverride
:
svctypes-example
fullnameOverride
:
svctypes-example
vikingService
:
service
:
type
:
NodePort
## 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
examples/svctypes/values.yaml
0 → 100644
View file @
7103cd44
apps
:
coffee
:
image
:
nginxdemos/hello:plain-text
replicas
:
2
tea
:
image
:
nginxdemos/hello:plain-text
replicas
:
3
ingress
:
name
:
cafe-ingress-varnish
rules
:
-
host
:
cafe.example.com
paths
:
-
path
:
/tea
app
:
tea
-
path
:
/coffee
app
:
coffee
vikingAdmSvc
:
svctypes-example-admin
examples/svctypes/verify.sh
View file @
7103cd44
...
@@ -6,8 +6,22 @@ source ${MYDIR}/../../test/utils.sh
...
@@ -6,8 +6,22 @@ source ${MYDIR}/../../test/utils.sh
IP
=
${
IP
:-
127
.0.0.1
}
IP
=
${
IP
:-
127
.0.0.1
}
LOCALPORT
=
${
LOCALPORT
:-
8888
}
LOCALPORT
=
${
LOCALPORT
:-
8888
}
wait_until_ready
app
=
varnish-ingress
# Wait for configuration by waiting for the loadBalancer IP in the
wait_until_configured
app
=
varnish-ingress
# Ingress to be set.
N
=
0
timeout
=
120
while
true
;
do
ip
=
$(
kubectl get ing cafe-ingress-varnish
-o
jsonpath
=
'{.status.loadBalancer.ingress[0].ip}'
)
if
[[
-n
${
ip
}
]]
;
then
break
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}'
)
...
@@ -30,7 +44,22 @@ else
...
@@ -30,7 +44,22 @@ else
PORT
=
${
LOCALPORT
}
PORT
=
${
LOCALPORT
}
kubectl port-forward svc/svctypes-example
${
PORT
}
:80
>
/dev/null &
kubectl port-forward svc/svctypes-example
${
PORT
}
:80
>
/dev/null &
trap
'kill $(jobs -p)'
EXIT
trap
'kill $(jobs -p)'
EXIT
wait_for_port
${
PORT
}
fi
fi
set
+e
N
=
0
while
true
;
do
cat
< /dev/null
>
/dev/tcp/
${
IP
}
/
${
PORT
}
if
[
$?
-eq
0
]
;
then
break
fi
if
[
$N
-ge
${
timeout
}
]
;
then
echo
"Timed out waiting for listener at
${
IP
}
:
${
PORT
}
"
exit
1
fi
sleep
1
N
=
$((
N
+
1
))
done
set
-e
varnishtest
${
TESTOPTS
}
-Dport
=
${
PORT
}
-Dip
=
${
IP
}
cafe.vtc
varnishtest
${
TESTOPTS
}
-Dport
=
${
PORT
}
-Dip
=
${
IP
}
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