- Python dependencies
pip3 install -r requirements.txt
- k8s Kind cluster
- For go(1.17+)
go install sigs.k8s.io/[email protected]
- For older version
GO111MODULE="on" go get sigs.k8s.io/[email protected]
- For go(1.17+)
- kubectl
To run the test:
python3 acto.py \
--candidates CANDIDATES, -c CANDIDATES yaml file to specify candidates for parameters
--seed SEED, -s SEED seed CR file
--operator OPERATOR, -o OPERATOR yaml file for deploying the operator
--helm OPERATOR_CHART Path of operator helm chart
--init INIT Path of init yaml file (deploy before operator)
--duration DURATION, -d DURATION Number of hours to run
--preload-images [PRELOAD_IMAGES [PRELOAD_IMAGES ...]]
Docker images to preload into Kind cluster
--crd-name CRD_NAME Name of CRD to use, required if there are multiple CRDs
--custom-fields CUSTOM_FIELDS Python source file containing a list of custom fields
--context CONTEXT Cached context data
--dryrun DRYRUN Only generate test cases without executing them
Example:
rabbitmq-operator:
python3 acto.py --seed data/rabbitmq-operator/cr.yaml \
--operator data/rabbitmq-operator/operator.yaml \
--custom-fields data.rabbitmq-operator.prune \
--context data/rabbitmq-operator/context.json
cass-operator (using kustomize)
python3 acto.py --seed data/cass-operator/cr.yaml \
--kustomize "github.com/k8ssandra/cass-operator/config/deployments/cluster?ref=v1.10.3" \
--init data/cass-operator/init.yaml \
--custom-fields data.cass-operator.prune \
--context data/cass-operator/context.json \
--crd-name cassandradatacenters.cassandra.datastax.com
zookeeper-operator (using helm)
python3 acto.py --candidates data/zookeeper-operator/candidates.yaml --seed data/zookeeper-operator/cr.yaml --helm data/zookeeper-operator/zookeeper-operator --duration 1 --crd-name=zookeeperclusters.zookeeper.pravega.io
mongodb-operator (using helm)
python3 acto.py --seed data/percona-server-mongodb-operator/cr.yaml \
--operator data/percona-server-mongodb-operator/bundle.yaml \
--context data/percona-server-mongodb-operator/context.json \
--crd-name perconaservermongodbs.psmdb.percona.com \
--custom-fields data.percona-server-mongodb-operator.prune
casskop-operator (using helm)
python3 acto.py --candidates data/casskop-operator/candidates.yaml --seed data/casskop-operator/cr.yaml --helm data/casskop-operator/cassandra-operator --init data/casskop-operator/init.yaml --duration 1 --crd-name=cassandraclusters.db.orange.com
nifikop-operator (using helm)
python3 acto.py --candidates data/nifikop-operator/candidates.yaml --seed data/nifikop-operator/cr.yaml --helm data/nifikop-operator/nifikop-operator --duration 1 --crd-name=nificlusters.nifi.orange.com
xtradb-operator (using helm)
python3 acto.py --candidates data/xtradb-operator/candidates.yaml --seed data/xtradb-operator/cr.yaml --helm data/xtradb-operator/xtradb-operator --duration 1 --crd-name=perconaxtradbclusters.pxc.percona.com
redis-operator
python3 acto.py --seed data/redis-operator/cr.yaml \
--operator data/redis-operator/all-redis-operator-resources.yaml \
--init data/redis-operator/databases.spotahome.com_redisfailovers.yaml \
--preload-images quay.io/spotahome/redis-operator:v1.1.0 redis:6.2.6-alpine \
--context data/redis-operator/context.json \
--custom-fields data.redis-operator.prune \
--duration 1
tidb-operator
python3 acto.py --seed data/tidb-operator/cr.yaml \
--helm data/tidb-operator/tidb-operator \
--init data/tidb-operator/crd.yaml \
--context data/tidb-operator/context.json \
--custom-fields data.tidb-operator.prune \
--crd-name tidbclusters.pingcap.com \
--duration 1
Acto aims to automate the E2E testing as much as possible to minimize users' labor.
Currently, porting operators still requires some manual effort, we need:
- A way to deploy the operator, the deployment method needs to handle all the necessary prerequisites to deploy the operator, e.g. CRD, namespace creation, RBAC, etc. Current we support three deploy methods:
yaml
,helm
, andkustomize
. For example, rabbitmq-operator usesyaml
for deployment, and the example is shown here - A seed CR yaml serving as the initial cr input. This can be any valid CR for your application. Example
- (Optional) (Not yet supported)A candidates file specifying possible values for some parameters. The candidates file's format is very similar to a CR, except you replace the values with another field
candidates
and specify a list of values undercandidates
. Example:A complete example for rabbitmq-operator is hereimage: candidates: - "rabbitmq:3.8.21-management" - "rabbitmq:latest" - "rabbitmq:3.9-management" - null