KAOS — K8s Agent 编排系统
在 Kubernetes 上以原生 CRD 的方式部署、管理和编排大规模分布式多 Agent 系统,每个 Agent 自动暴露 OpenAI 兼容接口。
- Star 数
- ★ 282
- 最近更新
- 6 天前
- License
- Apache-2.0
- 主语言
- Python
- FA 评分
- 69/100 · 存在缺口
30 秒速览
- 运行形态
- 可在哪里用
- 通用 · 跨平台OpenAI API
- 费用
- 免费,无需付费服务
- 上手难度
- 高 · 需要较重的基础设施
- 开始前需要
- 典型场景
- 平台工程团队需要把多个 AI Agent 作为 K8s 资源统一部署、扩缩和监控时
- 不适合
- 没有 Kubernetes 集群的团队,本项目核心依赖 K8s 运行时
- 只想在本地单机快速运行单个 Agent 的用户
- 不愿维护 operator、CRD 等基础设施的小团队
- 源码审查
- 69/100 · 存在缺口
这个 Agent 能做什么,适合哪些场景?
KAOS(K8s Agent Orchestration System)是一个 Kubernetes 原生框架,通过自定义资源(Agent、MCPServer、ModelAPI)部署和编排 AI Agent。其核心是一个 Go 编写的 Operator,包含 Agent Controller、MCPServer Controller 和 ModelAPI Controller 三个控制器,分别管理 Agent Pod、MCP 工具 Pod 和模型服务 Pod(支持 Ollama/LiteLLM)。Agent 运行时基于 PAIS(Pydantic AI Server),在 Pydantic AI 之上提供 OpenAI 兼容的 /v1/chat/completions HTTP API、分布式记忆、多 Agent 委托、A2A 发现、健康探针和 OpenTelemetry 埋点。用户可通过 kaos CLI 一键安装和管理,也可用 Helm 直接部署 Operator,并通过 Web UI 监控 Agent、测试对话和调试记忆与工具。项目采用 Apache-2.0 许可证,要求 Kubernetes >=1.28。
KAOS 的 Operator 持续监听三类 CRD:ModelAPI(以 Hosted 模式运行 Ollama/LiteLLM 等模型服务)、MCPServer(通过 Model Context Protocol 提供工具,可由 python-runtime 动态定义,如 tools.fromString 内嵌 Python 函数)和 Agent(绑定 modelAPI 与 mcpServers,支持 agentNetwork 定义层级多 Agent 网络)。部署后,每个 Agent 以 Pod 形式运行 PAIS 运行时,暴露 /v1/chat/completions 端点,可被 kubectl port-forward 后用 curl 调用。协调者 Agent 可自动将任务委托给 researcher、analyst 等专家 Agent。kaos CLI 提供 kaos system install、kaos modelapi deploy、kaos agent deploy、kaos agent invoke、kaos ui(打开 Web UI 并运行 kubectl proxy,可选 --monitoring-enabled 启用遥测)等命令;示例 YAML 在 operator/config/samples/ 下。
- 平台工程团队需要把多个 AI Agent 作为 K8s 资源统一部署、扩缩和监控时
- 需要构建层级式多 Agent 系统(协调者自动委托给专家 Agent)的团队
- 希望通过 MCP 标准为 Agent 挂载自定义 Python 工具的开发者
- 已有内部 LLM 网关或 Ollama,希望 Agent 通过 OpenAI 兼容接口被现有应用调用的团队
- 需要可视化监控 Agent 运行状态、测试对话并调试记忆与工具的运维人员
- 使用 kind 环境进行端到端测试的 CI/CD 流水线
如何安装或部署这个 Agent?
方式一:通过 CLI 安装(需要已配置的 Kubernetes 集群、kubectl 和 Helm):
pip install kaos-cli
kaos system install方式二:通过 Helm 直接安装 Operator:
helm repo add kaos https://axsaucedo.github.io/kaos/charts
helm repo update
helm install kaos kaos/kaos-operator -n kaos-system --create-namespace开发环境运行测试:
cd python && uv sync && uv run pytest tests/ -v
cd operator && make test
cd operator && make kind-create
cd operator && make kind-e2e-run-tests如何使用这个 Agent?
用 CLI 部署并调用 Agent:
kaos modelapi deploy my-api --mode Hosted --model "smollm2:135m"
kaos agent deploy my-agent --modelapi my-api --model "smollm2:135m"
kaos agent invoke my-agent --message "Hello"
kaos ui
kaos ui --monitoring-enabled或用 YAML 声明式部署(simple-agent.yaml):
apiVersion: kaos.tools/v1alpha1
kind: ModelAPI
metadata:
name: ollama
spec:
mode: Hosted
hostedConfig:
model: "smollm2:135m"
---
apiVersion: kaos.tools/v1alpha1
kind: MCPServer
metadata:
name: echo-tools
spec:
type: python-runtime
config:
tools:
fromString: |
def echo(message: str) -> str:
"""Echo back the message."""
return f"Echo: {message}"
---
apiVersion: kaos.tools/v1alpha1
kind: Agent
metadata:
name: assistant
spec:
modelAPI: ollama
mcpServers:
- echo-tools
config:
description: "AI assistant with echo tools"
instructions: "You are a helpful assistant."
env:
- name: MODEL_NAME
value: "ollama/smollm2:135m"kubectl apply -f simple-agent.yaml
kubectl wait --for=condition=ready pod -l agent=assistant --timeout=120s
kubectl port-forward svc/agent-assistant 8000:8000
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "assistant", "messages": [{"role": "user", "content": "Hello!"}]}'多 Agent 系统中,协调者 Agent 通过 agentNetwork.access 列出可委托的专家 Agent:
apiVersion: kaos.tools/v1alpha1
kind: Agent
metadata:
name: coordinator
spec:
modelAPI: ollama
config:
description: "Coordinator that delegates to specialists"
instructions: "Delegate research to researcher, calculations to analyst."
agentNetwork:
access:
- researcher
- analyst完整多 Agent 示例见 operator/config/samples/。
这个 Agent 有哪些优点和局限?
- 每个 Agent 自动暴露 OpenAI 兼容的 /v1/chat/completions 端点,现有 OpenAI 客户端代码无需改造即可接入
- 以 K8s CRD 声明式管理 Agent、工具和模型服务,可复用团队既有的 GitOps、Helm 和监控体系
- 原生支持层级式多 Agent 网络与自动任务委托,MCP 工具可用内嵌 Python 函数动态定义
- 内置 Web UI 支持监控 Agent、测试对话和调试记忆与工具,并可配合 SigNoz 启用 OpenTelemetry 遥测
- 必须拥有并运维 Kubernetes 集群(>=1.28)及 kubectl、Helm,没有 K8s 就无法使用
- 项目尚处早期(CRD 版本为 v1alpha1,文档按 v0.1.4 版本化),API 可能变动,生产采用有迁移风险
- 多组件架构(Operator、Agent Pod、MCP Server Pod、ModelAPI Pod)带来的资源开销和排障复杂度高于单体 Agent 框架
- README 中示例使用本地小模型 smollm2:135m,未提供托管 LLM 或计费层面的指引,模型接入需自行评估
这个 Agent 与同类方案有什么区别?
README 未直接对比竞品,但其 Agent 运行时 PAIS(pydantic-ai-server)是在 Pydantic AI 之上增加企业级服务器能力(OpenAI 兼容 API、分布式记忆、多 Agent 委托、A2A 发现、健康探针、OpenTelemetry)的封装;与直接使用 Pydantic AI 库相比,KAOS 额外提供 Kubernetes 层面的部署与编排。
与相关度最高的同类 agent 并排比较关键指标。
| Agent | 源码审查 | 形态 / 费用 | Star | 最近更新 | 主语言 | 完整支持的平台 |
|---|---|---|---|---|---|---|
| KAOS — K8s Agent 编排系统 当前 | 69 · 存在缺口 | 命令行工具免费 | ★ 282 | 6 天前 | Python | OpenAI API |
| kagent — Kubernetes 原生 AI 代理框架 | 43 · 缺口较多 | 开发框架免费 + 模型费 | ★ 4.2k | 今天 | Go | — |
| nanobot | 62 · 存在缺口 | 命令行工具免费 + 模型费 | ★ 50k | 今天 | Python | OpenAI API |
| Tares | 43 · 缺口较多 | — | ★ 44 | 今天 | Python | Codex · Claude Code · OpenAI API · Claude API |
FollowAgents 如何评估这个 Agent?
查看各维度的扣分理由
证据显示最强的默认最小权限设计:'声明即授权'、默认拒绝、fail-closed 的 PDP、AccessGrant 粒度到用户/组/Agent,均扣满分;扣分点在于敏感数据处理薄弱——CLI 测试显示登录令牌以明文写入 .kaos-config.yaml 且硬编码 kaos-dev-secret,依赖镜像普遍使用 latest 标签且无漏洞扫描证据;用户确认机制仅在 AIB 第三方令牌交换中提到 consent,无一般性确认流程;发布者为未验证个人仓库,版权仅为 'KAOS Contributors',归属支撑弱。
故障信息处理扎实:troubleshooting 章节、CLI 将 403 头映射为通俗英文拒绝原因并有对应单测覆盖(fail-closed、无身份、未授权组),满分;自洽性扣分——README 徽章称 k8s>=1.28 而安装文档写 v1.24+,README 与 quickstart 的 MCPServer spec 字段不一致(type/config.tools.fromString vs runtime/params),安装文档还有 your-org 占位 URL;依赖可用性有 Hosted/Proxy 双模式和多种安装途径,但 Hosted 首次拉模型耗时数分钟、部分文档引用另一仓库 PAIS。
受众(平台/平台用户)、CLI 与 Helm 双路径、Docker Desktop/kind/minikube/云集群及 arm64 构建均有覆盖,给 2;能力边界一节('Does not support':不支持每用户下游授权、90 秒传播延迟、仅 RS256)写得非常明确,满分;自主 Agent 的 interval/goal 触发是声明式的但缺少更细的触发约束说明,扣 1。
信息架构优秀:Docs Nav、架构 mermaid 图、分章节文档、示例目录索引齐全,满分;安装说明覆盖四种安装方式、验证、卸载与排障,满分;已知限制明确列出,满分;Apache-2.0 LICENSE 全文与 README 徽章一致,满分。扣分项:无 CHANGELOG,镜像默认 latest 标签,版本仅隐含在 VERSION 文件和 v0.1.4 文档链接中;MCPServer 字段在两份文档间命名漂移;维护者/治理信息仅 'KAOS Contributors',无维护承诺或更新路径说明,且发布者未经验证。
输出可用性良好:OpenAI 兼容 /v1/chat/completions 端点、CLI 的 JSON/人类可读双输出并有测试,给 2;边际价值在于把 Agent 编排、MCP 工具、授权与可观测性整合为 K8s 原生资源,有真实差异化但同类方案存在,给 2;成本收益方面需完整集群、可选 Gateway/Keycloak/AIB 等多组件,授权完整栈的运维成本不低,给 2。
文档声明多可落到 operator/config/samples/ 与 CLI 单测(拒绝原因映射、AccessGrant YAML 形状、会话头转发均有测试佐证),给 2;交叉印证总体成立但存在文档间不一致(k8s 版本、MCPServer 字段、your-org URL)拉低分数;事实与推断基本分离,但 'enterprise server wrapper' 等营销性措辞未加限定,安全文档高度具体可信,给 2。所有评分基于静态源码阅读,未经执行验证,置信度为 low。
- CLI 将登录令牌明文写入本地 .kaos-config.yaml(测试代码可证),共享机器上存在令牌泄露风险,请配合磁盘加密或谨慎使用。
- 默认镜像与 LiteLLM 依赖使用 latest/main-latest 标签,无法保证可复现性与供应链安全,生产部署应固定 digest。
- 文档间存在不一致:K8s 版本要求(1.28 vs 1.24+)、MCPServer spec 字段(config.tools.fromString vs params)、your-org 占位仓库地址,实际使用前需以代码为准。
- 授权策略与撤销传播约 90 秒延迟,且仅支持 RS256 签名验证;凭据轮换后需重启 operator。
- 静态审查未执行任何命令,安装命令、示例与测试的实际可用性未经独立验证。
- 发布者为未验证的个人 GitHub 账号,无维护承诺与治理信息,生产采用前请评估长期维护风险。
最近版本
来自该项目 GitHub Releases 的最新发布记录,说明为上游原文摘录,未经本站改写或测试。
-
发布说明摘录
What's Changed * chore: bump version to 0.8.5-dev by @github-actions[bot] in https://github.com/axsaucedo/kaos/pull/381 * chore(deps): bump the all group across 1 directory with 41 updates by @dependabot[bot] in https://github.com/axsaucedo/kaos/pull/384 * chore(deps-dev): bump brace-expansion from 5.0.8 to 5.0.12 in /kaos-ui in the all-security group across 1 directory by @dependabot[bot] in https://github.com/axsaucedo/kaos/pull/378 * chore(deps): bump the uv group across 3 directories with 2 updates by @dependabot[bot] in https://github.com/axsaucedo/kaos/pull/382 …在 GitHub 查看 ↗ -
发布说明摘录
Overview KAOS v0.8.4 is a dependency-maintenance release. It carries three grouped Dependabot updates — the Go control-plane modules, the Python lock set across all four Python directories, and 36 npm packages in kaos-ui — together with a change to how Dependabot proposes major versions in the first place. There are no changes to KAOS's own runtime code. There are no CRD, API, wire-format or Helm chart changes, and no behavioural changes to the operator, agent runtime, memory service, CLI or UI. Upgrading from v0.8.3 requires no migration. Highlights Control plane …在 GitHub 查看 ↗ -
发布说明摘录
Overview KAOS v0.8.3 is a maintenance release. It carries one grouped Dependabot update of eight npm packages in kaos-ui, all minor or patch, together with a fix to the memory-service test environment in CI. There are no changes to KAOS's own runtime code. There are no CRD, API or wire-format changes, and no behavioural changes to the operator, agent runtime, memory service or CLI. Upgrading from v0.8.2 requires no migration. Highlights UI - One grouped update of eight dependencies, all minor or patch: lucide-react …在 GitHub 查看 ↗