Commit 3d5f5a2a authored by Geoff Simmons's avatar Geoff Simmons

Add kubectl/yaml examples/tests for self-sharding by key, url & digest.

parent 1a78ad39
......@@ -52,6 +52,15 @@ deploy-self-sharding-kubectl: deploy-cafe-kubectl
deploy-primary-only-kubectl: deploy-cafe-kubectl
@kubectl apply -f primary-only.yaml
deploy-shard-by-digest-kubectl: deploy-cafe-kubectl
@kubectl apply -f shard-by-digest.yaml
deploy-shard-by-url-kubectl: deploy-cafe-kubectl
@kubectl apply -f shard-by-url.yaml
deploy-shard-by-key-kubectl: deploy-cafe-kubectl
@kubectl apply -f shard-by-key.yaml
# TESTOPTS are passed to varnishtest, e.g.: make TESTOPTS=-v verify
verify:
$(mkdir)/verify.sh
......@@ -82,11 +91,32 @@ undeploy-primary-only-kubectl:
$(MAKE) undeploy-cafe-kubectl
$(MAKE) wait
undeploy-shard-by-digest-kubectl:
@kubectl delete -f shard-by-digest.yaml
$(MAKE) undeploy-cafe-kubectl
$(MAKE) wait
undeploy-shard-by-url-kubectl:
@kubectl delete -f shard-by-url.yaml
$(MAKE) undeploy-cafe-kubectl
$(MAKE) wait
undeploy-shard-by-key-kubectl:
@kubectl delete -f shard-by-key.yaml
$(MAKE) undeploy-cafe-kubectl
$(MAKE) wait
ifeq ($(DEPLOY),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
deploy-shard-by-digest: deploy-shard-by-digest-kubectl
undeploy-shard-by-digest: undeploy-shard-by-digest-kubectl
deploy-shard-by-url: deploy-shard-by-url-kubectl
undeploy-shard-by-url: undeploy-shard-by-url-kubectl
deploy-shard-by-key: deploy-shard-by-key-kubectl
undeploy-shard-by-key: undeploy-shard-by-key-kubectl
else
deploy-self-sharding: deploy-self-sharding-helm
undeploy-self-sharding: undeploy-self-sharding-helm
......@@ -100,6 +130,15 @@ undeploy: undeploy-self-sharding
else ifeq ($(EXAMPLE),primary-only)
deploy: deploy-primary-only
undeploy: undeploy-primary-only
else ifeq ($(EXAMPLE),shard-by-digest)
deploy: deploy-shard-by-digest
undeploy: undeploy-shard-by-digest
else ifeq ($(EXAMPLE),shard-by-url)
deploy: deploy-shard-by-url
undeploy: undeploy-shard-by-url
else ifeq ($(EXAMPLE),shard-by-key)
deploy: deploy-shard-by-key
undeploy: undeploy-shard-by-key
else
deploy undeploy:
$(error EXAMPLE must be set to self-sharding or primary-only)
......
# Sample configuration for a self-sharding Varnish cluster
apiVersion: "ingress.varnish-cache.org/v1alpha1"
kind: VarnishConfig
metadata:
name: self-sharding-by-digest-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
key: req.http.Host
digest: SHA3_512
# Sample configuration for a self-sharding Varnish cluster
apiVersion: "ingress.varnish-cache.org/v1alpha1"
kind: VarnishConfig
metadata:
name: self-sharding-by-url-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
key: req.http.Host
# Sample configuration for a self-sharding Varnish cluster
apiVersion: "ingress.varnish-cache.org/v1alpha1"
kind: VarnishConfig
metadata:
name: self-sharding-by-digest-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
key: req.url
......@@ -71,6 +71,15 @@ make EXAMPLE=self-sharding deploy verify undeploy
echo Primary-only self-sharding cluster example
make EXAMPLE=primary-only deploy verify undeploy
echo Self-sharding by digest example
make EXAMPLE=shard-by-digest deploy verify undeploy
echo Self-sharding by URL example
make EXAMPLE=shard-by-url deploy verify undeploy
echo Self-sharding by key example
make EXAMPLE=shard-by-key deploy verify undeploy
echo Basic Authentication example
cd ${MYPATH}/../examples/authentication/
make EXAMPLE=basic-auth deploy verify undeploy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment