mirrord is an open-source tool that lets developers run local processes in the context of their cloud environment. It provides 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.
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.
ContentsVS Code Extension Installationmirrord uses your machine's default kubeconfig for access to the Kubernetes API.
Get the extension here.
How To UseIntelliJ Plugin Installation
Get the plugin here.
How To Use
CLI Tool Installation
You can use either
brew install metalbear-co/mirrord/mirrord
or
curl -fsSL https://raw.githubusercontent.com/metalbear-co/mirrord/main/scripts/install.sh | bash
How To Use
mirrord exec <process command> --target <target-path>
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 capabilitiesContainer run inside the pod launched by mirrord requires additional Linux capabilities:
CAP_NET_ADMIN
and CAP_NET_RAW
- for modifying routing tablesCAP_SYS_PTRACE
- for reading target pod environmentCAP_SYS_ADMIN
- for joining target pod network namespaceHowever, you can disable any subset of those in the configuration. This will possibly limit mirrord functionalities or even make it unusable in some setups.
MIRRORD_AGENT_DISABLED_CAPABILITIES=CAP_NET_RAW,CAP_SYS_PTRACE mirrord exec node app.js --target pod/my-pod
FAQ
Our FAQ is available here. If you have a question that's not on there, feel free to ask in our Discussions or on Discord.
Contributing
Contributions are very welcome. Start by checking out our open issues, and by going through our contributing guide. We're available on Discord for any questions.
Help and Community
Join our Discord Server for questions, support and fun.
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.
License
Twice a month we will interview people behind open source businesses. We will talk about how they are building a business on top of open source projects.
We'll never share your email with anyone else.