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
1aca523d
Commit
1aca523d
authored
Oct 12, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an example/test for primary-only self-sharding.
parent
7db3f020
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
20 deletions
+70
-20
.gitlab-ci.yml
.gitlab-ci.yml
+2
-1
Makefile
examples/self-sharding/Makefile
+36
-18
primary-only.yaml
examples/self-sharding/primary-only.yaml
+28
-0
e2e.sh
test/e2e.sh
+4
-1
No files found.
.gitlab-ci.yml
View file @
1aca523d
...
...
@@ -178,7 +178,8 @@ example:self-sharding:
extends
:
.integration-tests
script
:
-
cd ../examples/self-sharding
-
make deploy verify undeploy
-
make EXAMPLE=self-sharding deploy verify undeploy
-
make EXAMPLE=primary-only deploy verify undeploy
example:authentication:basic
:
extends
:
.integration-tests
...
...
examples/self-sharding/Makefile
View file @
1aca523d
...
...
@@ -34,22 +34,19 @@ CHARTDIR=$(mkdir)/../../charts
all
:
deploy
deploy-helm
:
deploy-
self-sharding-
helm
:
@
helm
install
viking-ingress
$(CHARTDIR)
/viking-test-app
\
--values
values.yaml
deploy-kubectl
:
deploy-
cafe-
kubectl
:
@
kubectl apply
-f
$(mkdir)
/../hello/cafe.yaml
@
kubectl apply
-f
$(mkdir)
/../hello/cafe-ingress.yaml
@
kubectl apply
-f
self-sharding-cfg.yaml
deploy
:
deploy-self-sharding-kubectl
:
deploy-cafe-kubectl
@
kubectl apply
-f
self-sharding-cfg.yaml
ifeq
($(DEPLOY),kubectl)
deploy
:
deploy-kubectl
else
deploy
:
deploy-helm
endif
deploy-primary-only-kubectl
:
deploy-cafe-kubectl
@
kubectl apply
-f
primary-only.yaml
# TESTOPTS are passed to varnishtest, e.g.: make TESTOPTS=-v verify
verify
:
...
...
@@ -59,24 +56,45 @@ wait:
@
echo
Waiting
until
varnish-ingress Pods are not configured
for
Ingress
$(TESTDIR)
/wait.sh
app
=
varnish-ingress
un
install
-helm
:
un
deploy-self-sharding
-helm
:
@
helm uninstall viking-ingress
$(MAKE)
wait
undeploy-helm
:
uninstall-helm wait
uninstall-kubectl
:
@
kubectl delete
-f
self-sharding-cfg.yaml
undeploy-cafe-kubectl
:
@
kubectl delete
-f
$(mkdir)
/../hello/cafe-ingress.yaml
@
kubectl delete
-f
$(mkdir)
/../hello/cafe.yaml
undeploy-kubectl
:
uninstall-kubectl wait
undeploy-self-sharding-kubectl
:
@
kubectl delete
-f
self-sharding-cfg.yaml
$(MAKE)
undeploy-cafe-kubectl
$(MAKE)
wait
undeploy
:
undeploy-primary-only-kubectl
:
@
kubectl delete
-f
primary-only.yaml
$(MAKE)
undeploy-cafe-kubectl
$(MAKE)
wait
ifeq
($(DEPLOY),kubectl)
undeploy
:
undeploy-kubectl
deploy-self-sharding
:
deploy-self-sharding-kubectl
undeploy-self-sharding
:
undeploy-self-sharding-kubectl
deploy-primary-only
:
deploy-primary-only-kubectl
undeploy-primary-only
:
undeploy-primary-only-kubectl
else
deploy-self-sharding
:
deploy-self-sharding-helm
undeploy-self-sharding
:
undeploy-self-sharding-helm
deploy-primary-only undeploy-primary-only
:
$
(
error primary-only not yet implemented
for
helm
)
endif
ifeq
($(EXAMPLE),self-sharding)
deploy
:
deploy-self-sharding
undeploy
:
undeploy-self-sharding
else
ifeq
($(EXAMPLE),primary-only)
deploy
:
deploy-primary-only
undeploy
:
undeploy-primary-only
else
undeploy
:
undeploy-helm
deploy undeploy
:
$
(
error EXAMPLE must be
set
to self-sharding or primary-only
)
endif
.PHONY
:
all $(MAKECMDGOALS)
examples/self-sharding/primary-only.yaml
0 → 100644
View file @
1aca523d
# Sample configuration for a self-sharding Varnish cluster
apiVersion
:
"
ingress.varnish-cache.org/v1alpha1"
kind
:
VarnishConfig
metadata
:
name
:
primary-only-sharding-cfg
spec
:
# The services array is required and must have at least one element.
# Lists the Service names of Varnish services in the same namespace
# to which this config is to be applied.
services
:
-
varnish-ingress-admin
# If the self-sharding object is present, then self-sharding will be
# implemented for the named service. All of its properties are
# optional, and defaults hold if they are left out. To just apply
# self-sharding with all default values, specify an empty object:
#
# self-sharding: {}
#
self-sharding
:
primaryOnly
:
true
probe
:
timeout
:
6s
interval
:
6s
initial
:
2
window
:
4
threshold
:
3
test/e2e.sh
View file @
1aca523d
...
...
@@ -66,7 +66,10 @@ make deploy verify undeploy
echo
Self-sharding cluster example
cd
${
MYPATH
}
/../examples/self-sharding/
make deploy verify undeploy
make
EXAMPLE
=
self-sharding deploy verify undeploy
echo
Primary-only self-sharding cluster example
make
EXAMPLE
=
primary-only deploy verify undeploy
echo
Basic Authentication example
cd
${
MYPATH
}
/../examples/authentication/
...
...
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