Transferring code from a developer’s local machine to a staging or testing environment is often complex in cloud-native applications. Typically, the workflow involves committing code to a version control system, after which a CI pipeline builds a container image with the new changes. Then, a CD tool such as Argo CD deploys that image to a Kubernetes cluster.
Only after this deployment can developers test their updates, making the process time-consuming when repeated frequently for each feature.
Problems With Shifting Application Testing Left
“Shift left” in software development refers to bringing processes, such as testing, earlier in the development lifecycle. This helps identify problems sooner, making them easier and faster to resolve, ultimately speeding up delivery. But despite its benefits, enabling early testing, it has several challenges:
Lack of Kubernetes knowledge among developers to deploy and test their code on a local cluster.
There’s also the risk of a developer’s code breaking something in the shared environment, leading to further delays.
Setting up a separate environment for each developer to avoid these issues can be costly and create significant maintenance overhead.
Shortening the Development Loop With mirrord
mirrord enables shift-left testing by allowing developers to instantly run their code in a real Kubernetes environment, without the need to rebuild or redeploy. It supports using a shared cluster for development, eliminating the overhead and cost of maintaining isolated personal environments.
Developers can connect directly to the same Kubernetes environment and safely test their changes rather than waiting for a CI pipeline. This significantly reduces iteration time, from 15–30 minutes per change to just a few seconds, while avoiding environment clashes.
mirrord consists of two main components:
mirrord comprises two primary components - mirrord-layer, a local component that runs alongside your application on your machine.
The other is mirrord-agent, a remote component that runs as a pod within your Kubernetes cluster.
When you run your app with mirrord, it connects your local process to the Kubernetes cluster by acting as a proxy. It redirects inputs and outputs so your code behaves like it’s running in the cluster (even though it is running locally), giving access to traffic, services, files, and configs, without needing to deploy.
Check out this full article by mirrord to see the setup and in-depth working, and explanation.