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
Switching to kuttl for MWT #138
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f1b00b1
Switching to kuttl for MWT
kensipe 7693711
mods based on PR review Co-authored-by: Zain Malik <zmalikshxil@gmail…
kensipe aa45c8c
Switching to kuttl for MWT
kensipe 072add9
mods based on PR review Co-authored-by: Zain Malik <zmalikshxil@gmail…
kensipe 0878622
adding test config files
kensipe 3eb9d07
switch to cassandra 1.0.0
kensipe d26e504
Merge branch 'ken/mwt' of mesosphere.com:mesosphere/kudo-cassandra-op…
ANeumann82 15ef14c
Ran ./tools/format_files.sh to make TC happy
ANeumann82 5492d73
Merge branch 'master' into ken/mwt
ANeumann82 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
kensipe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should test from the local path in this case if MWT scripts are living next to operator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zmalik I don't know what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are referring to using the local build of this operator in this repo... I would rather not... MWT should only be on released operators and the scripts should work against the released operator repo IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would generally agree, although with a project that is heavily in development this might not always be possible. For the last MWT I used a dev-version from master.
I do hope that we have reached a state where this won't be necessary anymore though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually participate with the next unreleased version in MWT to make sure there are no stability issues with the upcoming release under load tests.
that's a non-blocker issue as would require minimal effort to change it when running MWT. Moreover, now given the new dates we will participate with a released version so each time it will heavily dependent on operator release dates and MWT dates