Introduction¶
Chainsaw is a tool developed to run end to end tests in Kubernetes clusters.
How it works
It is meant to test Kubernetes operators work as expected by running a sequence of test steps for:
- creating resources
- and asserting operators react (or not) in the expected way.
Why we made it ?¶
While developing Kyverno we needed to run end to end tests to make sure our admission controller worked as expected.
A typical Kyverno end to end test
Kyverno can validate, mutate and generate resources based on policies installed in a cluster and a typical test is:
- Create a policy
- Create a resource
- Check that Kyverno acted as expected
- Cleanup and move to the next test
We started with another tool called KUTTL. While KUTTL is great we identified some limitations and forked the tool to add the features we needed.
But we ended up needing more flexibility than what KUTTL could offer and we started designing a new assertion model.
At this point it was simpler to start a new tool from scratch than continuing making changes in our KUTTL fork.
KUTTL compatibility
Migrating from KUTTL to Chainsaw should be easy, the assertion model used in KUTTL is compatible with Chainsaw. We provide a chainsaw kuttl migrate
command to help with the migration, see Migration from KUTTL for details.
Use cases¶
Chainsaw is built with CI tools in mind - you only really need to download and execute it in your build script.
Installing it in your machine is entirely up to you, but still possible.