mirrord

metalbear-co / mirrord

mirrord 让你在本地或 AI 代理环境中运行任意进程,并使其像 Kubernetes Pod 一样拥有真实的环境变量、DNS、网络和流量,用于贴近集群的开发调试。

Rust 开发工具 AI Agent 基础设施 Kubernetes 本地开发 微服务调试 开发环境

为什么值得看

编辑点评

它解决了本地开发环境与 Kubernetes 集群不一致的痛点,无需部署即可让本地进程接入集群网络和流量,非常适合微服务调试与远程开发。支持 AI 代理场景是亮点,但需注意对集群权限有一定要求,且复杂流量可能带来性能开销。适合需要频繁调试 Kubernetes 应用的开发者。

Star 趋势

近 7 日
  • Star 总数5,333
  • 今日新增+1
  • 7 日增速0%
  • Fork215

同类项目

同场景 · 开发工具 / AI Agent / 基础设施

项目文档

来自 GitHub README · main 分支

mirrord logo

mirrord runs your local process inside a live Kubernetes cluster. It works the same way for developers and for AI coding agents (Claude Code, Cursor, Codex, Copilot, Windsurf): your code runs on your machine, but mirrord routes its traffic, files, and environment variables through a target pod in the cluster.

That covers both halves of the software development loop. Read live cluster context while writing the code (real env vars, real service responses, real queue contents) so the change is grounded in what's actually deployed. Then run the code against those same services and data to confirm it works end-to-end.

You get the feedback of a deploy in seconds, without the deploy, and without disrupting the cluster for anyone else. mirrord ships as a VS Code extension, IntelliJ plugin, and CLI tool. Read more.

Adopted by: monday.com, SurveyMonkey, Cadence, CoLab, Daylight Security, Zooplus, and others.

Contents


Getting Started

mirrord uses your machine's default kubeconfig for access to the Kubernetes API.


VS Code Extension

Installation

Get the extension here.

How To Use

  • 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


IntelliJ Plugin

Installation

Get the plugin here.

How To Use

  • 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


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

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

or on Windows using Chocolatey:

choco install --pre mirrord

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 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.

MIRRORD_AGENT_DISABLED_CAPABILITIES=CAP_NET_RAW,CAP_SYS_PTRACE mirrord exec node app.js --target pod/my-pod

Using mirrord with AI coding agents

mirrord works first-class with Claude Code, Cursor, Codex CLI, Gemini CLI, and other AI coding agents, letting them run and verify generated code against real cluster services without deploying.

For setup guides and ready-made workflow skills, see metalbear-co/skills or the mirrord for AI Agents page.

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 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.

Help and Community

Join our Slack for questions, support and fun.

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.

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

MIT

CI Runners

文档抓取自 GitHub 仓库 README,版权归原作者所有;已过滤徽章等噪音并经安全消毒后展示。