mirrord
$ mirrord 官方出品 中风险mirrord 通过动态预加载层(LD_PRELOAD / DYLD_INSERT_LIBRARIES)包裹本地进程,使其无需构建容器镜像即可继承远程 Kubernetes Pod 的环境变量、文件系统与网络流量。
brew install mirrord mirrord 在 libc/系统调用层拦截本地二进制以镜像集群流量与环境变量,MCP 服务器无法实现该机制。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
显式传入 --target 与 -f mirrord.json 时可非交互运行,但 mirrord ls 缺少 --json 输出且省略目标参数会触发交互提示。
- Supports
-f <config>JSON/YAML configuration mirrord lslacks--jsonoutput flag
mirrord.json 支持只读文件系统与流量镜像模式,但会在集群侧创建特权 Agent Pod,配置不当可能劫持流量或写远程文件。
- Configurable read-only FS and mirror network modes
- Deploys remote agent pods and can intercept/steal pod traffic
提供 macOS、Linux 与原生 Windows 二进制,可通过 Homebrew 安装,但 macOS SIP 机制会限制系统签名二进制。
- macOS, Linux, and native Windows support
省去繁琐的 Docker 构建-推送-部署循环,大幅加速本地联调与集成测试。
- Zero-container-build local execution in pod context
MetalBear 官方团队(metalbear-co/mirrord)基于 MIT 协议开源维护,有商业产品持续支撑。
- Official
metalbear-co/mirrordrepository (MIT)
mirrord.dev 提供较完整的配置 Schema 文档,但动态库注入边界场景需查阅排障指南。
- Config reference at mirrord.dev
安全边界、鉴权与放权指南
使用当前 ~/.kube/config(KUBECONFIG)在集群中拉起临时 Agent Pod;MetalBear Teams 商业版额外使用 API Key 或 license.pem。
开源版 CLI 基于 MIT 协议免费;mirrord for Teams 团队版 Operator 需商业授权。
# mirrord Agent Rules - Always specify `-t <target>` and `-f <mirrord.json>` explicitly to avoid interactive target prompts. - Set `fs.mode: read` and `network.incoming.mode: mirror` in `mirrord.json` when testing against shared clusters. - Never steal live production traffic (`steal` mode) without explicit human confirmation.
Agent 高频安全命令配方
只读查询(安全推荐)
mirrord ls -n staging
打印命名空间内可注入的目标工作负载列表,不会在集群拉起 Agent Pod。
受控写入与预演
mirrord exec --target deployment/api -f .mirrord/mirrord.json -- pytest tests/integration
显式指定目标与只读镜像配置 .mirrord/mirrord.json 执行本地命令,避免交互式提示。
核心优势
- + 让本地测试套件或脚本直接复刻远程 Pod 的网络与环境变量上下文。
- + 声明式
mirrord.json支持严格限制只读文件系统与仅镜像流量。 - + 基于 Rust 的跨平台原生二进制,覆盖 macOS、Linux 与 Windows。
注意事项与踩坑点
- !
mirrord ls不支持--json结构化输出。 - ! 省略
--target或缺少mirrord.json时可能落入交互选择或误开启流量劫持模式。 - ! macOS SIP 会拦截对
/usr/bin下系统二进制的预加载注入。