AI Skills AI技能 12h ago Updated 9h ago 更新于 9小时前 43

Kagent on Kubernetes: What Does it Give Your AI Platform? Kagent on Kubernetes:能为你的AI平台带来什么?

kagent is an open-source Kubernetes operator that treats AI agents as declarative CRDs, enabling GitOps-friendly agent deployment via ~30 lines of YAML It supports two agent types: Declarative (using Google's ADK framework with kagent-managed reasoning loops) and BYO (Bring Your Own container with custom loop logic like LangGraph) The operator owns the workload lifecycle, reasoning loop, tool registration via MCP servers, and session state, while leaving platform concerns (namespaces, network po kagent 是一个开源 Kubernetes Operator,允许通过声明式 YAML(约 30 行)将 AI Agent 部署为 Pod,实现 GitOps 化的 Agent 管理 提供两种 Agent 模式:Declarative(使用内置 ADK 引擎,模型驱动循环)和 BYO(Bring Your Own,用户自定义容器实现推理循环) kagent 拥有 9 种自定义资源(CRD),覆盖模型配置、工具注册、会话状态、MCP 服务器等,但网络策略、密钥、身份等仍由平台团队管理 内置多个预置 Agent(k8s-agent、helm-agent、istio-agent 等)和 MCP

55
Hot 热度
70
Quality 质量
60
Impact 影响力

Analysis 深度分析

TL;DR

  • kagent is an open-source Kubernetes operator that treats AI agents as declarative CRDs, enabling GitOps-friendly agent deployment via ~30 lines of YAML
  • It supports two agent types: Declarative (using Google's ADK framework with kagent-managed reasoning loops) and BYO (Bring Your Own container with custom loop logic like LangGraph)
  • The operator owns the workload lifecycle, reasoning loop, tool registration via MCP servers, and session state, while leaving platform concerns (namespaces, network policy, secrets, RBAC) to the user
  • kagent introduces 9 custom resources under kagent.dev API group, including Agent, ModelConfig, MCPServer, Memory, and ToolServer CRDs for modular agent composition
  • Agent-to-agent communication follows the A2A protocol over pod-to-pod HTTP, with tool calls routed as network hops to separate MCP server workloads rather than in-process function calls

Why It Matters

kagent represents a significant step toward operationalizing AI agents at scale by applying Kubernetes-native declarative patterns to agent workloads, making them versionable, observable, and manageable through familiar platform engineering workflows. For AI practitioners, it bridges the gap between experimental agent prototypes and production-grade deployments by providing structured abstractions for model routing, tool discovery, and multi-agent orchestration without sacrificing the flexibility needed for custom reasoning loops.

Technical Details

  • CRD Architecture: kagent defines 9 custom resources (Agent, AgentHarness, MCPServer, Memory, ModelConfig, ModelProviderConfig, RemoteMCPServer, SandboxAgent, ToolServer) under the kagent.dev API group, each mapping to distinct concerns previously embedded in agent applications
  • Dual Agent Runtime: Declarative agents use kagent's built-in engine with Google's ADK framework, supporting Python and Go runtimes as HTTP services; BYO agents accept user-provided containers implementing the A2A protocol on port 8080, with full loop control via code (e.g., LangGraph StateGraph with explicit node transitions and conditional edges)
  • Tool Integration via MCP: Tools are registered as MCP servers (local or remote), enabling network-isolated tool execution with separate credential boundaries; the requireApproval field on tool references enables human-in-the-loop gating for sensitive operations
  • State and Configuration Management: ModelConfig and ModelProviderConfig CRDs decouple model selection and credential management from agent definitions, allowing runtime model swaps without agent redeployment; PostgreSQL backend stores session state and agent memory
  • Request Flow Architecture: Agent calls follow a pod-to-pod HTTP pattern using A2A protocol, with the controller acting as an optional front door rather than a dataplane hop; sub-agents are declared as peer tools in the same tools array as MCP servers, enabling recursive multi-agent orchestration

Industry Insight

  • The declarative vs BYO agent distinction reflects a broader industry tension between platform abstraction and developer control; organizations should adopt declarative agents for standard infrastructure operations (Kubernetes troubleshooting, cost monitoring, Helm management) while reserving BYO for complex, domain-specific reasoning patterns requiring testable loop logic
  • kagent's separation of concerns—owning the agent runtime while leaving platform security, networking, and identity to existing Kubernetes mechanisms—demonstrates a sustainable pattern for AI platform engineering that avoids reinventing operational primitives already solved by the Kubernetes ecosystem
  • The MCP-based tool registration model and A2A protocol for inter-agent communication signal convergence toward standardized agent interoperability; practitioners should evaluate these protocols when designing multi-agent systems to ensure future compatibility with emerging tooling and framework ecosystems

TL;DR

  • kagent 是一个开源 Kubernetes Operator,允许通过声明式 YAML(约 30 行)将 AI Agent 部署为 Pod,实现 GitOps 化的 Agent 管理
  • 提供两种 Agent 模式:Declarative(使用内置 ADK 引擎,模型驱动循环)和 BYO(Bring Your Own,用户自定义容器实现推理循环)
  • kagent 拥有 9 种自定义资源(CRD),覆盖模型配置、工具注册、会话状态、MCP 服务器等,但网络策略、密钥、身份等仍由平台团队管理
  • 内置多个预置 Agent(k8s-agent、helm-agent、istio-agent 等)和 MCP 工具服务器,支持 Agent 间通过 A2A 协议进行 Pod-to-Pod 调用
  • 架构上实现数据面与控制面分离,Agent 请求直接走 Pod 间通信,不经过 Controller,降低延迟和成本

为什么值得看

kagent 为 AI Agent 的 Kubernetes 原生部署提供了标准化的工程实践,解决了 Agent 作为长生命周期工作负载在状态管理、工具调用、多 Agent 协作等方面的平台化难题,对希望将 AI Agent 纳入现有 K8s 基础设施的团队具有重要参考价值。

技术解析

  • CRD 架构:kagent 定义了 9 种自定义资源(Agent、ModelConfig、ModelProviderConfig、MCPServer、Memory、AgentHarness、RemoteMCPServer、SandboxAgent、ToolServer),将 Agent 的核心组件抽象为 K8s 对象,支持版本控制和声明式管理
  • 双模式 Agent:Declarative 模式使用 kagent 内置引擎(基于 Google ADK),用户只需配置系统提示词、工具列表和模型配置;BYO 模式允许用户提交自定义容器镜像,通过 A2A 协议在 8080 端口提供服务,适合需要自定义推理循环的场景
  • 工具与 MCP 集成:支持 MCP(Model Context Protocol)服务器作为工具来源,可配置远程 MCP 服务器,Agent 可通过工具调用与其他 Agent 或外部系统交互,工具调用以网络请求形式执行而非进程内函数
  • 多 Agent 编排:Agent 间可通过声明式工具配置进行调用,如 incident-commander Agent 可调用 cluster-diagnostics、cloud-diagnostics 等子 Agent,调用历史通过 task.history[] 记录
  • 运行时隔离:每个 Agent 拥有独立的 Deployment、Service 和 ServiceAccount,Controller 仅作为可选入口,数据面流量直接 Pod-to-Pod,避免单点瓶颈

行业启示

  • Agent 平台化趋势:AI Agent 正从独立应用演变为 Kubernetes 原生工作负载,Operator 模式为 Agent 的生命周期管理、版本控制和资源隔离提供了成熟的基础设施范式
  • 声明式 vs 自定义的权衡:Declarative 模式适合快速迭代和标准场景(如平台运维 Agent),BYO 模式适合需要精细控制推理逻辑的复杂应用,团队应根据需求选择合适模式
  • 平台工程边界清晰化:kagent 明确划分了 Operator 负责的范围(工作负载、推理循环、工具注册、状态)与平台团队仍需管理的领域(命名空间、网络策略、密钥、RBAC),为 AI 基础设施的权责划分提供了参考框架

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Open Source 开源 Agent Agent Deployment 部署 LLM 大模型