From 1ba0401d90974fbc37a4ab5b48ccf1f8d41fc711 Mon Sep 17 00:00:00 2001 From: Sun-ZhenXing <1006925066@qq.com> Date: Sat, 7 Feb 2026 20:45:43 +0800 Subject: [PATCH] feat(agentgateway): add Agentgateway service with configuration files and documentation --- README.md | 1 + README.zh.md | 1 + src/agentgateway/.env.example | 18 ++++++++++ src/agentgateway/README.md | 52 ++++++++++++++++++++++++++++ src/agentgateway/README.zh.md | 52 ++++++++++++++++++++++++++++ src/agentgateway/config.yaml | 21 +++++++++++ src/agentgateway/docker-compose.yaml | 35 +++++++++++++++++++ 7 files changed, 180 insertions(+) create mode 100644 src/agentgateway/.env.example create mode 100644 src/agentgateway/README.md create mode 100644 src/agentgateway/README.zh.md create mode 100644 src/agentgateway/config.yaml create mode 100644 src/agentgateway/docker-compose.yaml diff --git a/README.md b/README.md index 7e9e52b..06859cf 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ These services require building custom Docker images from source. | [Apache Kafka](./src/kafka) | 7.8.0 | | [Apache Pulsar](./src/pulsar) | 4.0.7 | | [Apache RocketMQ](./src/rocketmq) | 5.3.1 | +| [Agentgateway](./src/agentgateway) | 0.11.2 | | [Bifrost Gateway](./src/bifrost-gateway) | v1.3.63 | | [Bolt.diy](./apps/bolt-diy) | latest | | [Budibase](./src/budibase) | 3.23.0 | diff --git a/README.zh.md b/README.zh.md index 51453e0..0e20f85 100644 --- a/README.zh.md +++ b/README.zh.md @@ -28,6 +28,7 @@ Compose Anything 通过提供一组高质量的 Docker Compose 配置文件, | [Apache Kafka](./src/kafka) | 7.8.0 | | [Apache Pulsar](./src/pulsar) | 4.0.7 | | [Apache RocketMQ](./src/rocketmq) | 5.3.1 | +| [Agentgateway](./src/agentgateway) | 0.11.2 | | [Bifrost Gateway](./src/bifrost-gateway) | v1.3.63 | | [Bolt.diy](./apps/bolt-diy) | latest | | [Budibase](./src/budibase) | 3.23.0 | diff --git a/src/agentgateway/.env.example b/src/agentgateway/.env.example new file mode 100644 index 0000000..2ab8bd5 --- /dev/null +++ b/src/agentgateway/.env.example @@ -0,0 +1,18 @@ +# Agentgateway image version +AGENTGATEWAY_VERSION=0.11.2 + +# Timezone +TZ=UTC + +# Admin UI bind address inside the container +AGENTGATEWAY_ADMIN_ADDR=0.0.0.0:15000 + +# Port overrides (optional) +# AGENTGATEWAY_PORT_OVERRIDE=3000 +# AGENTGATEWAY_ADMIN_PORT_OVERRIDE=15000 + +# Resource limits +# AGENTGATEWAY_CPU_LIMIT=0.50 +# AGENTGATEWAY_CPU_RESERVATION=0.25 +# AGENTGATEWAY_MEMORY_LIMIT=256M +# AGENTGATEWAY_MEMORY_RESERVATION=128M diff --git a/src/agentgateway/README.md b/src/agentgateway/README.md new file mode 100644 index 0000000..b7c6ed5 --- /dev/null +++ b/src/agentgateway/README.md @@ -0,0 +1,52 @@ +# Agentgateway + +[English](./README.md) | [中文](./README.zh.md) + +Agentgateway is an open source data plane for agentic AI connectivity. This compose setup runs the official Docker image with a local configuration file. + +## Services + +- `agentgateway`: The Agentgateway data plane (ports 3000 and 15000) + +## Quick Start + +```bash +docker compose up -d +``` + +Agentgateway listens on port 3000. The admin UI is available on . + +## Configuration + +The default configuration file is [config.yaml](./config.yaml). It is based on the official quickstart example and starts the MCP test server `@modelcontextprotocol/server-everything` via `npx`. + +If you want to use a different backend, update `config.yaml` and restart the service. + +## Environment Variables + +| Variable Name | Description | Default Value | +| ---------------------------------- | ------------------------------------------------- | --------------- | +| `GLOBAL_REGISTRY` | Global registry prefix for all images | `""` | +| `AGENTGATEWAY_VERSION` | Agentgateway image version | `0.11.2` | +| `AGENTGATEWAY_PORT_OVERRIDE` | Host port mapping for data plane (container 3000) | `3000` | +| `AGENTGATEWAY_ADMIN_PORT_OVERRIDE` | Host port mapping for admin UI (container 15000) | `15000` | +| `AGENTGATEWAY_ADMIN_ADDR` | Admin UI bind address inside container | `0.0.0.0:15000` | +| `TZ` | Timezone | `UTC` | +| `AGENTGATEWAY_CPU_LIMIT` | CPU limit | `0.50` | +| `AGENTGATEWAY_CPU_RESERVATION` | CPU reservation | `0.25` | +| `AGENTGATEWAY_MEMORY_LIMIT` | Memory limit | `256M` | +| `AGENTGATEWAY_MEMORY_RESERVATION` | Memory reservation | `128M` | + +## Ports + +- `3000`: Data plane listener +- `15000`: Admin UI + +## Security Notes + +- The admin UI is bound to localhost on the host by default. Change the port mapping if you need remote access. +- Review and harden CORS and backend settings before using in production. + +## License + +Agentgateway is open source and licensed under the Apache 2.0 License. See the upstream project for details. diff --git a/src/agentgateway/README.zh.md b/src/agentgateway/README.zh.md new file mode 100644 index 0000000..fffdb3a --- /dev/null +++ b/src/agentgateway/README.zh.md @@ -0,0 +1,52 @@ +# Agentgateway + +[English](./README.md) | [中文](./README.zh.md) + +Agentgateway 是一个面向智能体 AI 连接的开源数据平面。本 Compose 配置运行官方 Docker 镜像,并使用本地配置文件。 + +## 服务 + +- `agentgateway`:Agentgateway 数据平面(端口 3000 与 15000) + +## 快速开始 + +```bash +docker compose up -d +``` + +Agentgateway 监听端口 3000。管理界面可通过 访问。 + +## 配置说明 + +默认配置文件为 [config.yaml](./config.yaml)。该文件基于官方 Quickstart 示例,并通过 `npx` 启动 MCP 测试服务器 `@modelcontextprotocol/server-everything`。 + +如需使用其他后端,请修改 `config.yaml` 并重启服务。 + +## 环境变量 + +| 变量名 | 说明 | 默认值 | +| ---------------------------------- | ------------------------------ | --------------- | +| `GLOBAL_REGISTRY` | 全局镜像仓库前缀 | `""` | +| `AGENTGATEWAY_VERSION` | Agentgateway 镜像版本 | `0.11.2` | +| `AGENTGATEWAY_PORT_OVERRIDE` | 数据平面端口映射(容器 3000) | `3000` | +| `AGENTGATEWAY_ADMIN_PORT_OVERRIDE` | 管理界面端口映射(容器 15000) | `15000` | +| `AGENTGATEWAY_ADMIN_ADDR` | 容器内管理界面绑定地址 | `0.0.0.0:15000` | +| `TZ` | 时区 | `UTC` | +| `AGENTGATEWAY_CPU_LIMIT` | CPU 限制 | `0.50` | +| `AGENTGATEWAY_CPU_RESERVATION` | CPU 预留 | `0.25` | +| `AGENTGATEWAY_MEMORY_LIMIT` | 内存限制 | `256M` | +| `AGENTGATEWAY_MEMORY_RESERVATION` | 内存预留 | `128M` | + +## 端口 + +- `3000`:数据平面监听 +- `15000`:管理界面 + +## 安全说明 + +- 默认仅在宿主机本地暴露管理界面。如需远程访问,请调整端口映射。 +- 在生产环境中,请根据实际需求收紧 CORS 与后端配置。 + +## 许可证 + +Agentgateway 采用 Apache 2.0 许可证,详情请参考上游项目。 diff --git a/src/agentgateway/config.yaml b/src/agentgateway/config.yaml new file mode 100644 index 0000000..ea3f08a --- /dev/null +++ b/src/agentgateway/config.yaml @@ -0,0 +1,21 @@ +binds: + - port: 3000 + listeners: + - routes: + - policies: + cors: + allowOrigins: + - "*" + allowHeaders: + - mcp-protocol-version + - content-type + - cache-control + exposeHeaders: + - "Mcp-Session-Id" + backends: + - mcp: + targets: + - name: everything + stdio: + cmd: npx + args: ["@modelcontextprotocol/server-everything"] diff --git a/src/agentgateway/docker-compose.yaml b/src/agentgateway/docker-compose.yaml new file mode 100644 index 0000000..32769bd --- /dev/null +++ b/src/agentgateway/docker-compose.yaml @@ -0,0 +1,35 @@ +x-defaults: &defaults + restart: unless-stopped + logging: + driver: json-file + options: + max-size: 100m + max-file: "3" + +services: + agentgateway: + <<: *defaults + image: ${GLOBAL_REGISTRY:-}cr.agentgateway.dev/agentgateway:${AGENTGATEWAY_VERSION:-0.11.2} + ports: + - "${AGENTGATEWAY_PORT_OVERRIDE:-3000}:3000" + - "127.0.0.1:${AGENTGATEWAY_ADMIN_PORT_OVERRIDE:-15000}:15000" + volumes: + - ./config.yaml:/config.yaml:ro + environment: + - TZ=${TZ:-UTC} + - ADMIN_ADDR=${AGENTGATEWAY_ADMIN_ADDR:-0.0.0.0:15000} + command: ["-f", "/config.yaml"] + healthcheck: + test: ["CMD", "agentgateway", "--version"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + deploy: + resources: + limits: + cpus: ${AGENTGATEWAY_CPU_LIMIT:-0.50} + memory: ${AGENTGATEWAY_MEMORY_LIMIT:-256M} + reservations: + cpus: ${AGENTGATEWAY_CPU_RESERVATION:-0.25} + memory: ${AGENTGATEWAY_MEMORY_RESERVATION:-128M}