This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switching to kuttl for MWT Signed-off-by: Ken Sipe <[email protected]> * mods based on PR review Co-authored-by: Zain Malik <[email protected]> Signed-off-by: Ken Sipe <[email protected]> * Switching to kuttl for MWT Signed-off-by: Ken Sipe <[email protected]> * mods based on PR review Co-authored-by: Zain Malik <[email protected]> Signed-off-by: Ken Sipe <[email protected]> * adding test config files Signed-off-by: Ken Sipe <[email protected]> * switch to cassandra 1.0.0 Signed-off-by: Ken Sipe <[email protected]> * Ran ./tools/format_files.sh to make TC happy Signed-off-by: Andreas Neumann <[email protected]> Co-authored-by: Andreas Neumann <[email protected]>
- Loading branch information
1 parent
215d2c0
commit f77da1c
Showing
17 changed files
with
221 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kubeconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
1. assert kudo | ||
k kudo init --wait | ||
k kudo init --wait --unsafe-self-signed-webhook-ca | ||
|
||
2. create ns | ||
3. install CR | ||
assert | ||
4. install with params | ||
with instance name | ||
assert | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes cluster up | ||
- KUDO CLI installed on node kuttl is running from | ||
- KUDO manager installed in the cluster | ||
|
||
# TestSuites | ||
|
||
- **Setup:** used to setup a MWT test use the following command | ||
|
||
`kubectl kuttl test setup/ --parallel 1 --skip-delete` | ||
|
||
or | ||
|
||
`kubectl kuttl test --config kuttl-setup.yaml` | ||
|
||
The `parallel 1` is important for setup, as the order of the folders and the | ||
order of there execution matters. The tests are designed to allow for a restart. | ||
If kudo confirmation is guaranteed, it is possible to run: | ||
`kubectl kuttl test setup/ --parallel 1 --skip-delete --test 01-cassandra-install`. | ||
The tests inside "cassandra-install" are also allowed to run multiple tests with | ||
good end results. This is the reason command failures are ignored. If a command | ||
fails we don't care unless the desired asserted state is not reached (which is | ||
built into the test). | ||
|
||
- **Teardown:** used to remove cassandra (and verify it has been removed) | ||
|
||
`kubectl kuttl test --config kuttl-teardown.yaml` | ||
|
||
## Tests under **Setup** | ||
|
||
- 00-kudo-check: confirms | ||
|
||
1. commands locally are present | ||
2. kudo manager is ready at the server | ||
|
||
- 01-cassandra-install | ||
1. first creates and asserts "cassandra" namespace exists | ||
2. installs the cassandra CR and asserts they exist | ||
3. installs cassandra with parameters and asserts that the deployment plan is | ||
complete | ||
4. runs the nodetool on node 0 for output to stdout | ||
|
||
**NOTES:** | ||
|
||
1. The MWT parameter values need to be changed. This was built and tested on | ||
konvoy but not on a MWT env | ||
2. The timeouts may need to change. In particular the wait for namespace, the | ||
wait for deploy to finish and the wait for deletes. | ||
3. This was tested with konvoy with config setting established with | ||
`./konvoy apply kubeconfig --force-overwrite` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
parallel: 1 | ||
skipDelete: true | ||
timeout: 30 | ||
testDirs: | ||
- setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
parallel: 1 | ||
timeout: 30 | ||
testDirs: | ||
- teardown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: kudo-manager | ||
name: kudo-controller-manager-0 | ||
namespace: kudo-system | ||
status: | ||
containerStatuses: | ||
- name: manager | ||
ready: true | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: instances.kudo.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl kudo init --client-only | ||
# ensures all commands are present and that kudo is installed locally... test failure if not true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: cassandra | ||
status: | ||
phase: Active |
6 changes: 6 additions & 0 deletions
6
benchmarks/mwt/setup/01-cassandra-install/00-install-namespace.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl create namespace cassandra | ||
ignoreFailure: true | ||
# if we can't create a namespace, it is likely because it already exists, if that is the case, 00-assert will catch it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: Operator | ||
metadata: | ||
name: cassandra | ||
namespace: cassandra |
4 changes: 4 additions & 0 deletions
4
benchmarks/mwt/setup/01-cassandra-install/01-install-crd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl kudo install cassandra --skip-instance --namespace cassandra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 600 | ||
--- | ||
|
||
apiVersion: kudo.dev/v1beta1 | ||
kind: Instance | ||
metadata: | ||
name: cassandra | ||
namespace: cassandra | ||
status: | ||
planStatus: | ||
deploy: | ||
name: deploy | ||
status: COMPLETE |
20 changes: 20 additions & 0 deletions
20
benchmarks/mwt/setup/01-cassandra-install/02-install-cassandra.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: Instance | ||
metadata: | ||
name: cassandra | ||
namespace: cassandra | ||
spec: | ||
operatorVersion: | ||
name: cassandra-1.0.0 | ||
namespace: cassandra | ||
kind: OperatorVersion | ||
name: "cassandra" | ||
parameters: | ||
NODE_COUNT: "10" | ||
NODE_MEM_MIB: "8196" | ||
NODE_MEM_LIMIT_MIB: "8196" | ||
NODE_CPU_MC: "6000" | ||
NODE_CPU_LIMIT_MC: "6000" | ||
NODE_DISK_SIZE_GIB: "100" | ||
PROMETHEUS_EXPORTER_CPU_MC: "1000" | ||
PROMETHEUS_EXPORTER_CPU_LIMIT_MC: "1000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl exec "pod/cassandra-node-0" -n cassandra -c cassandra -- bash -c "nodetool status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
parameters: | ||
NODE_COUNT: "3" | ||
NODE_MEM_MIB: "4096" | ||
NODE_MEM_LIMIT_MIB: "4096" | ||
NODE_CPU_MC: "1000" | ||
NODE_CPU_LIMIT_MC: "1000" | ||
NODE_DISK_SIZE_GIB: "20" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl delete instance cassandra --namespace cassandra | ||
ignoreFailure: true | ||
- command: kubectl delete operatorversion --all --namespace cassandra | ||
ignoreFailure: true | ||
- command: kubectl delete operator cassandra --namespace cassandra | ||
ignoreFailure: true | ||
|
||
# kuttl doesn't support custom namespace deletes... yet | ||
# delete: | ||
# - apiVersion: kudo.dev/v1beta1 | ||
# kind: Instance | ||
# metadata: | ||
# name: cassandra | ||
# namespace: cassandra | ||
# - apiVersion: kudo.dev/v1beta1 | ||
# kind: OperatorVersion | ||
# metadata: | ||
# namespace: cassandra | ||
# - apiVersion: kudo.dev/v1beta1 | ||
# kind: Operator | ||
# metadata: | ||
# namespace: cassandra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: Instance | ||
metadata: | ||
name: cassandra | ||
namespace: cassandra | ||
|
||
--- | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: OperatorVersion | ||
metadata: | ||
namespace: cassandra | ||
|
||
--- | ||
apiVersion: kudo.dev/v1beta1 | ||
kind: Operator | ||
metadata: | ||
namespace: cassandra |