- Notifications
You must be signed in to change notification settings - Fork115
Connect your local process and your cloud environment, and run local code in cloud conditions.
License
metalbear-co/mirrord
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 actuallygoing 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 ithere.
mirrord uses your machine's default kubeconfig for access to the Kubernetes API.
Get the extensionhere.
- Click "Enable mirrord" on the status bar
- Start debugging your project
- Choose pod to impersonate
- The debugged process will be plugged into the selected pod by mirrord
Get the pluginhere.
- Click the mirrord icon in the Navigation Toolbar
- Start debugging your project
- Choose a namespace and pod to impersonate
- The debugged process will be plugged into the selected pod by mirrord
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
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)
mirrordexec<process command> --target<target-path>
e.g.
mirrordexec node app.js --target pod/my-pod
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 ithere.
Container run inside the pod launched by mirrord requires additionalLinux capabilities:
CAP_NET_ADMIN
andCAP_NET_RAW
- for modifying routing tablesCAP_SYS_PTRACE
- for reading target pod environmentCAP_SYS_ADMIN
- for joining target pod network namespace
However, you can disable any subset of those in theconfiguration.This will possibly limit mirrord functionalities or even make it unusable in some setups.
MIRRORD_AGENT_DISABLED_CAPABILITIES=CAP_NET_RAW,CAP_SYS_PTRACE mirrordexec node app.js --target pod/my-pod
Our FAQ is availablehere.If you have a question that's not on there, feel free to ask in ourDiscussionsor onDiscord.
Contributions are very welcome. Start by checking out ouropen issues, and by going through ourcontributing guide.We're available onDiscord for any questions.
Join ourDiscord Server for questions, support and fun.
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 ourCode of Conduct.
About
Connect your local process and your cloud environment, and run local code in cloud conditions.