Skip to content

Commit

Permalink
Use Helm chart to deploy e2e operator env
Browse files Browse the repository at this point in the history
* Helm charts are now used in the kind-operator test env
* Enable Meridio and TAPA versions in the test scope
* Set hostPID to true in vpp-forwarder
  • Loading branch information
LionelJouin committed Apr 5, 2023
1 parent 9c7328d commit 115ca87
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/demo/deployments/nsm/templates/forwarder-vpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
"spiffe.io/spiffe-id": "true"
spec:
hostNetwork: true
hostPID: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- image: {{ .Values.registry }}/{{ .Values.organization }}/{{ .Values.forwarderVPPImage }}:{{ .Values.tag }}
Expand Down
20 changes: 17 additions & 3 deletions test/e2e/environment/kind-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ WAIT_TIMEOUT ?= 4m # Kubectl wait timeout

BASE_PATH ?= $(shell pwd)/../../../..

HELM_REGISTRY ?= https://artifactory.nordix.org/artifactory/cloud-native/meridio

#############################################################################
##@ Environment
#############################################################################
Expand All @@ -41,14 +43,15 @@ environment: ## Deploy the enviroment (Kind + Gateways + NSM + Spire)

.PHONY: operator
operator: ## Deploy operator
$(MAKE) -s -C $(BASE_PATH) deploy OPERATOR_NAMESPACE=$(NAMESPACE)
helm install meridio-crds $(HELM_REGISTRY)/Meridio-CRDs-$(shell $(MAKE) -s format-version VERSION=$(MERIDIO_VERSION)).tgz --create-namespace --namespace $(NAMESPACE) ; \
helm install meridio $(HELM_REGISTRY)/Meridio-$(shell $(MAKE) -s format-version VERSION=$(MERIDIO_VERSION)).tgz --create-namespace --namespace $(NAMESPACE)

.PHONY: trenches-targets
trenches-targets: ## Deploy trench-a + trench-b + target-a + target-b
kubectl apply -f $(IP_FAMILY)/configuration/init-trench-a.yaml ; \
kubectl apply -f $(IP_FAMILY)/configuration/init-trench-b.yaml ; \
helm install target-a $(BASE_PATH)/examples/target/deployments/helm/ --create-namespace --namespace red --set applicationName=target-a --set default.trench.name=trench-a --set default.conduit.name=conduit-a-1 --set default.stream.name=stream-a-i ; \
helm install target-b $(BASE_PATH)/examples/target/deployments/helm/ --create-namespace --namespace red --set applicationName=target-b --set default.trench.name=trench-b --set default.conduit.name=conduit-b-1 --set default.stream.name=stream-b-i
helm install target-a $(HELM_REGISTRY)/Meridio-Target-$(shell $(MAKE) -s format-version VERSION=$(TAPA_VERSION)).tgz --create-namespace --namespace $(NAMESPACE) --set applicationName=target-a --set default.trench.name=trench-a --set default.conduit.name=conduit-a-1 --set default.stream.name=stream-a-i ; \
helm install target-b $(HELM_REGISTRY)/Meridio-Target-$(shell $(MAKE) -s format-version VERSION=$(TAPA_VERSION)).tgz --create-namespace --namespace $(NAMESPACE) --set applicationName=target-b --set default.trench.name=trench-b --set default.conduit.name=conduit-b-1 --set default.stream.name=stream-b-i

.PHONY: wait-operator
wait-operator:
Expand All @@ -65,3 +68,14 @@ wait-trenches-targets:
.PHONY: wait
wait:
sleep $(WAIT_TIME)

# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
# https://github.com/semver/semver/pull/724
VERSION_REGEX = ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$
.PHONY: format-version
format-version:
version="$(VERSION)" ; \
if ! echo "$${version}" | grep -Eq "$(VERSION_REGEX)" ; then \
version="v0.0.0-$${version}" ; \
fi ; \
printf "$${version}"
4 changes: 4 additions & 0 deletions test/e2e/environment/kind-operator/test-scope.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
Meridio:
- latest
- v1.0.4
- v1.0.3
TAPA:
- latest
- v1.0.4
- v1.0.3
NSM:
- v1.5.0
- v1.6.0
Expand Down

0 comments on commit 115ca87

Please sign in to comment.