From cbcdf79edcd4da5c635c2e11d1eb2951f2f36bbe Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Thu, 18 Oct 2018 08:52:28 +0200 Subject: [PATCH 1/3] add templates and generation script --- tests/acceptance/activefailover.template.yaml | 10 +++++ .../acceptance/cluster-scale-1.template.yaml | 12 ++++++ .../acceptance/cluster-scale-2.template.yaml | 14 +++++++ .../acceptance/cluster-scale-3.template.yaml | 14 +++++++ .../acceptance/cluster-scale-4.template.yaml | 14 +++++++ tests/acceptance/cluster-sync.template.yaml | 12 ++++++ tests/acceptance/cluster.template.yaml | 10 +++++ tests/acceptance/generate.sh | 41 +++++++++++++++++++ tests/acceptance/single.template.yaml | 10 +++++ 9 files changed, 137 insertions(+) create mode 100644 tests/acceptance/activefailover.template.yaml create mode 100644 tests/acceptance/cluster-scale-1.template.yaml create mode 100644 tests/acceptance/cluster-scale-2.template.yaml create mode 100644 tests/acceptance/cluster-scale-3.template.yaml create mode 100644 tests/acceptance/cluster-scale-4.template.yaml create mode 100644 tests/acceptance/cluster-sync.template.yaml create mode 100644 tests/acceptance/cluster.template.yaml create mode 100755 tests/acceptance/generate.sh create mode 100644 tests/acceptance/single.template.yaml diff --git a/tests/acceptance/activefailover.template.yaml b/tests/acceptance/activefailover.template.yaml new file mode 100644 index 000000000..32d8acea6 --- /dev/null +++ b/tests/acceptance/activefailover.template.yaml @@ -0,0 +1,10 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-activefailover" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: ActiveFailover diff --git a/tests/acceptance/cluster-scale-1.template.yaml b/tests/acceptance/cluster-scale-1.template.yaml new file mode 100644 index 000000000..04a93aecc --- /dev/null +++ b/tests/acceptance/cluster-scale-1.template.yaml @@ -0,0 +1,12 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-cluster" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: Cluster + dbservers: + count: 5 diff --git a/tests/acceptance/cluster-scale-2.template.yaml b/tests/acceptance/cluster-scale-2.template.yaml new file mode 100644 index 000000000..3562664ec --- /dev/null +++ b/tests/acceptance/cluster-scale-2.template.yaml @@ -0,0 +1,14 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-cluster" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: Cluster + dbservers: + count: 5 + coordinators: + count: 4 diff --git a/tests/acceptance/cluster-scale-3.template.yaml b/tests/acceptance/cluster-scale-3.template.yaml new file mode 100644 index 000000000..3509d14b3 --- /dev/null +++ b/tests/acceptance/cluster-scale-3.template.yaml @@ -0,0 +1,14 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-cluster" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: Cluster + dbservers: + count: 2 + coordinators: + count: 4 diff --git a/tests/acceptance/cluster-scale-4.template.yaml b/tests/acceptance/cluster-scale-4.template.yaml new file mode 100644 index 000000000..f3679a411 --- /dev/null +++ b/tests/acceptance/cluster-scale-4.template.yaml @@ -0,0 +1,14 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-cluster" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: Cluster + dbservers: + count: 2 + coordinators: + count: 1 diff --git a/tests/acceptance/cluster-sync.template.yaml b/tests/acceptance/cluster-sync.template.yaml new file mode 100644 index 000000000..b0c15f547 --- /dev/null +++ b/tests/acceptance/cluster-sync.template.yaml @@ -0,0 +1,12 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-cluster" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: Cluster + sync: + enabled: true diff --git a/tests/acceptance/cluster.template.yaml b/tests/acceptance/cluster.template.yaml new file mode 100644 index 000000000..94ab5cc6e --- /dev/null +++ b/tests/acceptance/cluster.template.yaml @@ -0,0 +1,10 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-cluster" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: Cluster diff --git a/tests/acceptance/generate.sh b/tests/acceptance/generate.sh new file mode 100755 index 000000000..fe5d8694b --- /dev/null +++ b/tests/acceptance/generate.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -u + +version="arangodb-preview:3.4.0-rc.3" +enterprise_secret="9c169fe900ff79790395784287bfa82f0dc0059375a34a2881b9b745c8efd42e" +community="arangodb/$version" +enterprise="registry.arangodb.com/arangodb/$version-$enterprise_secret" + +rm generated/* + +for path in *.template.yaml; do + base_file="${path%.template.yaml}" + target="./generated/$base_file-community-dev.yaml" + cp "$path" "$target" + sed -i "s|@IMAGE@|$community|" "$target" + sed -i "s|@ENVIRONMENT@|Development|" "$target" +done + +for path in *.template.yaml; do + base_file="${path%.template.yaml}" + target="./generated/$base_file-community-pro.yaml" + cp "$path" "$target" + sed -i "s|@IMAGE@|$community|" "$target" + sed -i "s|@ENVIRONMENT@|Production|" "$target" +done + +for path in *.template.yaml; do + base_file="${path%.template.yaml}" + target="./generated/$base_file-enterprise-dev.yaml" + cp "$path" "$target" + sed -i "s|@IMAGE@|$enterprise|" "$target" + sed -i "s|@ENVIRONMENT@|Development|" "$target" +done + +for path in *.template.yaml; do + base_file="${path%.template.yaml}" + target="./generated/$base_file-enterprise-pro.yaml" + cp "$path" "$target" + sed -i "s|@IMAGE@|$enterprise|" "$target" + sed -i "s|@ENVIRONMENT@|Production|" "$target" +done diff --git a/tests/acceptance/single.template.yaml b/tests/acceptance/single.template.yaml new file mode 100644 index 000000000..58b5a6b74 --- /dev/null +++ b/tests/acceptance/single.template.yaml @@ -0,0 +1,10 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-single" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: Single From c86797330386d19df0a85a1f13963f537ad0d352 Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Thu, 18 Oct 2018 08:55:44 +0200 Subject: [PATCH 2/3] add .gitignore and be more verbose --- tests/acceptance/.gitignore | 1 + tests/acceptance/generate.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/acceptance/.gitignore diff --git a/tests/acceptance/.gitignore b/tests/acceptance/.gitignore new file mode 100644 index 000000000..86d4c2dd3 --- /dev/null +++ b/tests/acceptance/.gitignore @@ -0,0 +1 @@ +generated diff --git a/tests/acceptance/generate.sh b/tests/acceptance/generate.sh index fe5d8694b..016dc4a7d 100755 --- a/tests/acceptance/generate.sh +++ b/tests/acceptance/generate.sh @@ -6,7 +6,8 @@ enterprise_secret="9c169fe900ff79790395784287bfa82f0dc0059375a34a2881b9b745c8efd community="arangodb/$version" enterprise="registry.arangodb.com/arangodb/$version-$enterprise_secret" -rm generated/* +rm -fr generated +mkdir -p generated for path in *.template.yaml; do base_file="${path%.template.yaml}" @@ -14,6 +15,7 @@ for path in *.template.yaml; do cp "$path" "$target" sed -i "s|@IMAGE@|$community|" "$target" sed -i "s|@ENVIRONMENT@|Development|" "$target" + echo "created $target" done for path in *.template.yaml; do @@ -22,6 +24,7 @@ for path in *.template.yaml; do cp "$path" "$target" sed -i "s|@IMAGE@|$community|" "$target" sed -i "s|@ENVIRONMENT@|Production|" "$target" + echo "created $target" done for path in *.template.yaml; do @@ -30,6 +33,7 @@ for path in *.template.yaml; do cp "$path" "$target" sed -i "s|@IMAGE@|$enterprise|" "$target" sed -i "s|@ENVIRONMENT@|Development|" "$target" + echo "created $target" done for path in *.template.yaml; do @@ -38,4 +42,5 @@ for path in *.template.yaml; do cp "$path" "$target" sed -i "s|@IMAGE@|$enterprise|" "$target" sed -i "s|@ENVIRONMENT@|Production|" "$target" + echo "created $target" done From f19cb1707bdf58ebe8fa3d85dffc04db8a78e5b3 Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Thu, 18 Oct 2018 13:20:56 +0200 Subject: [PATCH 3/3] add template for cluster local storage --- tests/acceptance/cluster-local-storage.template.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/acceptance/cluster-local-storage.template.yaml diff --git a/tests/acceptance/cluster-local-storage.template.yaml b/tests/acceptance/cluster-local-storage.template.yaml new file mode 100644 index 000000000..65a32bdaf --- /dev/null +++ b/tests/acceptance/cluster-local-storage.template.yaml @@ -0,0 +1,11 @@ +apiVersion: "database.arangodb.com/v1alpha" +kind: "ArangoDeployment" +metadata: + name: "acceptance-cluster" +spec: + environment: @ENVIRONMENT@ + image: @IMAGE@ + externalAccess: + type: LoadBalancer + mode: Cluster + storageClassName: acceptance