Kassette: How We Built a No-Code Testing Tool for Kubernetes Resources
Why we open-sourced Kassette: A resource recording inspired testing tool for the Kubernetes community
At Lifen, we're on a mission to transform healthcare through technology. As a healthcare company, we operate two product lines: Lifen Care (featuring Lifen Documents for medical document exchange and Lifen Integration for automated document analysis) and Lifen Research (with Lifen Datalab for AI-powered medical document structuring). Behind these solutions, we run more than 75 decentralized applications in production on Kubernetes—all deployed using a single Helm chart.
This unified approach brings tremendous benefits: standardization, shared features across projects, and streamlined operations. However, it also presents a significant challenge: ensuring quality across diverse use cases without breaking existing functionality. Our solution? A Test-Driven Development (TDD) approach with extensive test coverage, executed locally and through our CI pipeline on every pull request.
In this context, we developed Kassette—a tool that makes testing easier by eliminating the need to write test code. Today, we're excited to open-source this solution and share the journey that led us here.
Our Testing Evolution Journey
Step 1: Unittest - When Code Was King
As an infrastructure team working primarily in Python, we initially relied on the standard unittest framework. Our testing process involved creating a minikube cluster, then for each test case:
Deploying the test case Helm release
Running unittest
Uninstalling the Helm test case release
Let's look at a concrete example with the web-with-hpa test case. Here are our chart values:
And the corresponding unittest code:
This approach required substantial code for relatively simple tests, making it time-consuming and error-prone.
Step 2: Behave/Gherkin - The Human-Readable Attempt
Seeking better readability, we moved to behave, Python's implementation of Gherkin - a "human readable" language for describing expected behavior.
Our web-with-hpa.feature file looked like this:
With the corresponding Python implementation:
While more readable and reusable, this approach still required code and forced us to explicitly define what to test for each scenario.
Step 3: Kassette - The No-Code Approach
Kassette
The VCR Inspiration
At Lifen, we love Ruby, so we naturally took inspiration from VCR, applying its record/replay concept to Kubernetes resources.
VCR is a Ruby project designed to record/replay HTTP requests for test runs. It offers several key advantages:
Makes every test run deterministic
Avoids real HTTP requests to external services in CI
Eliminates the need to mock HTTP requests, so write additional code for it
We realized this same principle could help Kubernetes testing.
How Kassette Works
Kassette allows you to write chart tests in a "no-code" way using simple YAML configuration files. Here's how our web-with-hpa/kassette.yaml file looks:
Core Features
Kassette provides three essential commands:
bin/kassette record: Takes YAML snapshots of defined resources based on yourkassette.yamlconfigurationbin/kassette diff: Compares recorded snapshots with current Kubernetes cluster resourcesbin/kassette modify: Enables mass modification of resources in snapshots
The workflow is straightforward: the record subcommand reads your kassette.yaml file and captures the current state of described resources. Later, the diff subcommand compares these recorded states with current states, outputting differences and exiting with a non-zero code if divergences are found.
For example, when there is a divergence:
Implementation Details
We chose Python for Kassette's implementation for several reasons:
Seamless integration with our existing test suite
Common language across our infrastructure team
Widespread adoption in the DevOps community
Real Impact at Lifen
Since implementing Kassette, we've observed the following improvements:
Enhanced Testing Culture: The tool's simplicity has made our team more committed to comprehensive testing practices.
Broader Test Coverage: We now cover many more scenarios than previously possible, with tests that are easier to create and maintain.
Faster Onboarding: New team members can contribute to our testing efforts without extensive coding knowledge.
Deterministic Results: Like VCR for HTTP requests, Kassette ensures our Kubernetes tests are predictable and reliable.
Open Source and Community Impact
Today, we are proud to open-source the first version of Kassette at https://github.com/honestica/kassette/
We believe Kassette solve problems that many DevOps teams using Kubernetes face, and we're excited to share this solution with the broader community.
Our hope is that Kassette will help spread testing culture throughout the DevOps community while enabling us to continuously improve the tool based on real-world feedbacks and contributions.
Join Our Mission
We built Kassette because we believe in sharing what works.
At Lifen, we face real infrastructure challenges—from scaling our platform to maintaining healthcare-grade reliability—and we've learned that the best solutions often come from the community. If solving meaningful technical problems alongside a passionate team sounds interesting, take a look at our open positions on Welcome to the Jungle.
We're excited to see what you'll build with Kassette !








