mirrord: Bridging Local Development with Kubernetes Environments
mirrord is a powerful tool designed to connect your local development environment with Kubernetes, enabling you to run local code in cloud conditions without deploying it. This innovative solution allows developers to test and debug applications as if they were running in a production environment, all from their local machine.
Key Features:
Multi-platform Support: Available as a Visual Studio Code extension, IntelliJ plugin, and CLI tool, mirrord integrates seamlessly into your workflow.
Traffic Mirroring: Enables bidirectional communication between your local process and Kubernetes pods, ensuring accurate testing of network interactions.
File Operations Handling: Automatically mirrors file reads and writes between your local machine and the Kubernetes environment.
Environment Variable Management: Synchronizes environment variables from the target pod to your local process for consistent behavior.
Customizable Capabilities: Offers flexibility by allowing developers to disable specific Linux capabilities, though this may limit functionality.
Audience & Benefits:
Ideal for developers working with Kubernetes, especially those focused on backend development. By using mirrord, you can achieve faster iteration cycles and reduce the risk of deploying untested code to production environments. This tool provides a seamless way to integrate local development with cloud setups, ensuring your application behaves consistently across all stages.
mirrord is installed via winget, making it easy to set up and start leveraging its capabilities immediately.
README
mirrord lets developers run local processes in the context of their Kubernetes environment.
It’s meant to provide the benefits of running your service on a cloud environment (e.g. staging) without actually
going through the hassle of deploying it there, and without disrupting the environment by deploying untested code.
It comes as a Visual Studio Code extension, an IntelliJ plugin and a CLI tool. You can read more about it here.
or using Nix (not official, community maintained):
# Using nix-env (legacy)
nix-env -iA nixpkgs.mirrord
# Using nix profile (recommended)
nix profile install nixpkgs#mirrord
Windows isn't currently supported (you can use WSL)
How To Use
mirrord exec --target
e.g.
mirrord exec node app.js --target pod/my-pod
How It Works
When you select a pod to impersonate, mirrord launches a pod on the same node as the pod you selected.
The new pod is then used to connect your local process and the impersonated pod: it mirrors incoming traffic from the pod to your process,
routes outgoing traffic from your process through the pod, and does the same for file reads, file writes, and environment variables.
You can read more about it here.
Additional capabilities
Container run inside the pod launched by mirrord requires additional Linux capabilities:
CAP_NET_ADMIN and CAP_NET_RAW - for modifying routing tables
CAP_SYS_PTRACE - for reading target pod environment
CAP_SYS_ADMIN - for joining target pod network namespace
However, you can disable any subset of those in the configuration.
This will possibly limit mirrord functionalities or even make it unusable in some setups.
Our FAQ is available here.
If you have a question that's not on there, feel free to ask in our Discussions
or on Slack.
Contributing
Contributions are very welcome. Start by checking out our open issues, and by going through our contributing guide.
We're available on Slack for any questions.
We always appreciate hearing how mirrord has made a difference for our users.
Check out our ADOPTERS.md to see how others are using mirrord —
and open a pull request to add your organization if you’d like to share how mirrord has been useful to you.
KubeCon Atlanta Raffle
The password is: "The blind rooster crows at midnight."
Say it to one of our team members at Booth #1560.
Code of Conduct
We take our community seriously and we are dedicated to providing a safe and welcoming environment for everyone.
Please take a few minutes to review our Code of Conduct.