在 Kubernetes 中运行 Nix 环境
Run Nix Based Environments in Kubernetes

原始链接: https://flox.dev/kubernetes/

Flox 提供了一种新的应用部署方法,摒弃了传统的容器镜像,转而采用**由配方定义的声明式环境**。这些配方解析为存储在本地的不可变、哈希寻址的软件包,使组织能够维护私有、签名的二进制缓存,以增强安全性和溯源性。 该系统带来诸如**自动生成 SBOM、简化的 A/B 测试和回滚,以及更快的漏洞分类**等优势。重要的是,现有的安全工作流程保持兼容,因为仅在运行时获取经过验证的工件。 对于开发者而言,Flox 环境充当**子 shell**,提供对本地资源的直接访问以及与 Git 仓库的无缝集成——这意味着开发、CI 和生产都使用*相同的*环境。这简化了 SDLC 并促进了全方位的统一性。

## Flox:在 Kubernetes 中运行 Nix 环境 - 摘要 Flox 由 Ron(来自 Flox 团队,现在还有 Jeremy)带领的团队推出,旨在简化在 Kubernetes 中运行基于 Nix 的环境。其核心创新在于利用预先评估的 Nix 目录,避免在 Kubernetes 节点上进行运行时 Nix 评估,从而实现更快速、更安全的部署并改善缓存共享。这与 `nix-snapshotter` 等工具不同,因为它完全跳过了 Nix 评估。 该项目通过提供哈希固定、可重现的环境,解决了 Docker 镜像膨胀的问题,尤其是在 AI/ML 工作负载中。Flox 目前处于 alpha 阶段,尚未开源(但计划开源),它为跨不同平台(而不仅仅是 Kubernetes)部署和管理 Nix 环境提供了一种简化的工作流程。 讨论强调了对抽象深度和潜在调试困难的担忧,以及可重现性的好处。团队承认这些担忧,并专注于简单性,并计划很快开源该项目。他们强调 Flox 环境旨在作为运行时部署,而不仅仅是开发 shell。
相关文章

原文

You replace build-push-pull image pipelines with a declarative Flox environment, the dependencies of which resolve to hash-addressed packages that live in an immutable, node-local store. Organizations can run their own private, signed binary caches, enabling them to build or mirror packages inside their networks, generate SBOMs and attestations (see SBOMs, below), and point security scanners at that cache. At runtime, nodes fetch only hash-addressed artifacts, so existing provenance, approval, and CVE workflows carry over.

In sum: organizations shift from shipping snapshots (container images) to shipping recipes (declarative environments); recipes yield SBOMs-by-default, single-edit A/B and atomic rollbacks, faster CVE triaging, and other operational benefits. For developers, AI/ML engineers, and other practitioners, Flox environments run as subshells, not containers, so developers can work directly on their local systems, with free access to all resources. Flox development environments are co-located with Git repos, so PRs always update code and runtime together. The same environment travels across the SDLC: local dev → CI → production Kubernetes clusters.

联系我们 contact @ memedata.com