144 lines
8.9 KiB
Markdown
144 lines
8.9 KiB
Markdown
<!-- WEHUB_ZH_README -->
|
||
> [!NOTE]
|
||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||
> [English](./README.en.md) · [原始项目](https://github.com/Kong/kong) · [上游 README](https://github.com/Kong/kong/blob/HEAD/README.md)
|
||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||
|
||
[![][kong-logo]][kong-url]
|
||
|
||
  [![Build Status][badge-action-image]][badge-action-url]   [](https://x.com/thekonginc)
|
||
|
||
|
||
Kong 或 Kong Gateway 是一款云原生、跨平台、可扩展的 **API 𖧹 LLM 𖧹 MCP** 网关,以高性能和通过插件实现的扩展性而著称。它还提供先进的 AI 流量能力,支持多 LLM、语义安全(semantic security)、MCP 流量安全与分析等功能。
|
||
|
||
通过提供代理、路由、负载均衡、健康检查、身份验证(以及[更多功能](#features)),Kong 可轻松作为编排微服务或传统 API 流量——以及智能体 LLM 与 MCP——的中心层。
|
||
|
||
借助官方 [Kubernetes Ingress Controller](https://github.com/Kong/kubernetes-ingress-controller).,Kong 可在 Kubernetes 上原生运行。
|
||
|
||
<br />
|
||
|
||
[![][kong-diagram]][kong-url]
|
||
|
||
---
|
||
|
||
[安装](https://konghq.com/install/#kong-community) | [文档](https://docs.konghq.com) | [讨论](https://github.com/Kong/kong/discussions) | [论坛](https://discuss.konghq.com) | [博客](https://konghq.com/blog) | [构建][kong-master-builds] | [AI Gateway](https://konghq.com/products/kong-ai-gateway) | [Cloud Hosted Kong](https://konghq.com/kong-konnect/)
|
||
|
||
---
|
||
|
||
## 快速入门
|
||
|
||
如果你更倾向使用云托管 Kong,可以[注册 Kong Konnect 免费试用](https://konghq.com/products/kong-konnect/register?utm_medium=Referral&utm_source=Github&utm_campaign=kong-gateway&utm_content=konnect-promo-in-gateway&utm_term=get-started),几分钟即可上手。否则,可按照下方说明在你自己的基础设施上部署 Kong。
|
||
|
||
让我们在 5 分钟内为 API 添加身份验证,快速体验 Kong。
|
||
|
||
我们建议通过以下说明使用 docker-compose 发行版,但如果你更希望以 DB-less 模式运行 Kong Gateway,也可参考 [Docker 安装](https://docs.konghq.com/gateway/latest/install/docker/#install-kong-gateway-in-db-less-mode) 流程。
|
||
|
||
无论你是在云端、裸机上还是使用容器运行,都可以在我们的[官方安装](https://konghq.com/install/#kong-community) 页面找到所有受支持的发行版。
|
||
|
||
1) 首先,克隆 Docker 仓库并进入 compose 文件夹。
|
||
```cmd
|
||
$ git clone https://github.com/Kong/docker-kong
|
||
$ cd docker-kong/compose/
|
||
```
|
||
|
||
2) 使用以下命令启动 Gateway 堆栈:
|
||
```cmd
|
||
$ KONG_DATABASE=postgres docker-compose --profile database up
|
||
```
|
||
|
||
Gateway 现已在 localhost 的以下端口上可用:
|
||
|
||
- `:8000` - 通过 Kong 将流量发送至你的服务
|
||
- `:8001` - 使用 Admin API 或通过 [decK](https://github.com/kong/deck) 配置 Kong
|
||
- `:8002` - 访问 Kong 管理 Web UI([Kong Manager](https://github.com/Kong/kong-manager)),地址为 [localhost:8002](http://localhost:8002)
|
||
|
||
接下来,请按照[快速入门指南](https://docs.konghq.com/gateway-oss/latest/getting-started/configuring-a-service/
|
||
)浏览 Gateway 功能。
|
||
|
||
### 面向 LLM 与 MCP 的 AI Gateway 快速入门
|
||
|
||
如果你想体验 Kong AI Gateway 的 LLM 与 MCP 等功能,请参阅[官方 AI 文档](https://developer.konghq.com/ai-gateway/).
|
||
|
||
## 功能特性
|
||
|
||
通过将组织内各项服务共通的 API、AI 与 MCP 能力集中管理,Kong Gateway 让工程团队更自由地专注于真正重要的挑战。
|
||
|
||
Kong 的主要功能包括:
|
||
|
||
- 高级路由、负载均衡、健康检查——均可通过 RESTful 管理 API 或声明式配置进行设置。
|
||
- 面向 API 的身份验证与授权,支持 JWT、基本认证(basic auth)、OAuth、ACL 等多种方式。
|
||
- 通用 LLM API,可在 OpenAI、Anthropic、GCP Gemini、AWS Bedrock、Azure AI、Databricks、Mistral、Huggingface 等多家提供商之间路由。
|
||
- MCP 流量治理、MCP 安全与 MCP 可观测性,并支持从任意 RESTful API 自动生成 MCP。
|
||
- 60 余项 AI 功能,包括 AI 可观测性、语义安全与缓存、语义路由等。
|
||
- 代理、SSL/TLS 终止,以及对 L4 或 L7 流量的连接支持。
|
||
- 用于强制执行流量控制、限流、请求/响应转换、日志、监控等的插件,并提供插件开发者中心。
|
||
- 精密的部署模型,如声明式无数据库部署(Declarative Databaseless Deployment)和混合部署(控制平面/数据平面分离),且无供应商锁定。
|
||
- 原生 [Ingress Controller](https://github.com/Kong/kubernetes-ingress-controller) 支持,可在 Kubernetes 上提供服务。
|
||
|
||
[![][kong-benefits]][kong-url]
|
||
|
||
### 插件中心(Plugin Hub)
|
||
|
||
插件提供可扩展 Gateway 用途的高级功能。Kong Inc. 及社区开发的众多插件(如 AWS Lambda、Correlation ID、Response Transformer)可在[插件中心](https://docs.konghq.com/hub/). 查看。
|
||
|
||
为插件中心做出贡献,让你的下一个创新想法得以发布并惠及更广泛的社区!
|
||
|
||
## 参与贡献
|
||
|
||
我们❤️ pull request,并持续努力让开发者尽可能轻松地参与贡献。在开始基于 Kong Gateway 进行开发之前,请先熟悉以下开发者资源:
|
||
|
||
- 社区承诺([COMMUNITY_PLEDGE.md](COMMUNITY_PLEDGE.md)):我们与开源社区互动的承诺。
|
||
- 贡献者指南([CONTRIBUTING.md](CONTRIBUTING.md)):了解如何为 Kong 做出贡献。
|
||
- 开发指南([DEVELOPER.md](DEVELOPER.md)):搭建开发环境。
|
||
- [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) 与 [COPYRIGHT](COPYRIGHT)
|
||
|
||
使用[插件开发指南](https://docs.konghq.com/latest/plugin-development/) 构建新颖创意的插件,或在[插件开发套件(PDK)参考](https://docs.konghq.com/latest/pdk/). 中浏览 Kong 源代码文档的在线版本。开发者可使用 [Lua](https://docs.konghq.com/gateway/latest/plugin-development/),、[Go](https://docs.konghq.com/gateway-oss/latest/external-plugins/#developing-go-plugins) 或 [JavaScript](https://docs.konghq.com/gateway-oss/latest/external-plugins/#developing-javascript-plugins). 构建插件。
|
||
|
||
## 发布版本
|
||
|
||
有关各版本发布的更多详情,请参阅[更新日志](CHANGELOG.md)。Gateway 版本号遵循 [SemVer 规范](https://semver.org)。
|
||
|
||
## 加入社区
|
||
|
||
- 查阅[文档](https://docs.konghq.com/)
|
||
- 加入 [Kong 讨论论坛](https://github.com/Kong/kong/discussions)
|
||
- 在 Kong Nation 论坛参与 Kong 讨论:[https://discuss.konghq.com/](https://discuss.konghq.com/)
|
||
- 加入我们的[社区 Slack](http://kongcommunity.slack.com/)
|
||
- 在我们的[博客](https://konghq.com/blog/) 了解最新动态
|
||
- 在 [X](https://x.com/thekonginc) 关注我们
|
||
- 订阅我们的 [YouTube 频道](https://www.youtube.com/c/KongInc/videos)
|
||
- 访问我们的[主页](https://konghq.com/) 了解更多
|
||
|
||
## Konnect Cloud
|
||
|
||
Kong Inc. 提供商业订阅,以多种方式增强 Kong Gateway。Kong [Konnect Cloud](https://konghq.com/kong-konnect/) 订阅客户可享受额外的网关功能、商业支持,以及 Kong 托管(SaaS)控制平面平台的访问权限。Konnect Cloud 平台功能包括实时分析、服务目录、开发者门户等 使用 Konnect Cloud。
|
||
|
||
## 许可证
|
||
|
||
```
|
||
Copyright 2016-2026 Kong Inc.
|
||
|
||
Licensed under the Apache License, Version 2.0 (the "License");
|
||
you may not use this file except in compliance with the License.
|
||
You may obtain a copy of the License at
|
||
|
||
https://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
Unless required by applicable law or agreed to in writing, software
|
||
distributed under the License is distributed on an "AS IS" BASIS,
|
||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
See the License for the specific language governing permissions and
|
||
limitations under the License.
|
||
```
|
||
|
||
[kong-url]: https://konghq.com/
|
||
[kong-logo]: https://konghq.com/wp-content/uploads/2018/05/kong-logo-github-readme.png
|
||
[kong-diagram]: https://assets.prd.mktg.konghq.com/images/2025/09/68cc1bfd-kong-diagram.png?v=2
|
||
[kong-benefits]: https://konghq.com/wp-content/uploads/2018/05/kong-benefits-github-readme.png
|
||
[kong-master-builds]: https://hub.docker.com/r/kong/kong/tags
|
||
[badge-action-url]: https://github.com/Kong/kong/actions
|
||
[badge-action-image]: https://github.com/Kong/kong/actions/workflows/build_and_test.yml/badge.svg?branch=master&event=push
|
||
|
||
[busted]: https://github.com/Olivine-Labs/busted
|
||
[luacheck]: https://github.com/mpeterv/luacheck
|