From ce2e1c4f4f7122eca5cd6cb60d065ffb8a8954c4 Mon Sep 17 00:00:00 2001 From: Sun-ZhenXing <1006925066@qq.com> Date: Wed, 25 Feb 2026 14:54:54 +0800 Subject: [PATCH] feat: add agentgateway template and update kgateway template --- src/agentgateway/Makefile | 32 ++++++++++++ src/agentgateway/README.md | 98 +++++++++++++++++++++++++++++++++++ src/agentgateway/README.zh.md | 98 +++++++++++++++++++++++++++++++++++ src/agentgateway/values.yaml | 72 +++++++++++++++++++++++++ src/kgateway/Makefile | 21 +++++++- src/kgateway/README.md | 39 ++++++++++++-- src/kgateway/README.zh.md | 39 ++++++++++++-- 7 files changed, 392 insertions(+), 7 deletions(-) create mode 100644 src/agentgateway/Makefile create mode 100644 src/agentgateway/README.md create mode 100644 src/agentgateway/README.zh.md create mode 100644 src/agentgateway/values.yaml diff --git a/src/agentgateway/Makefile b/src/agentgateway/Makefile new file mode 100644 index 0000000..4e61547 --- /dev/null +++ b/src/agentgateway/Makefile @@ -0,0 +1,32 @@ +HELM_RELEASE_NAME ?= agentgateway +HELM_APPLICATION_NAME ?= agentgateway +HELM_NAMESPACE ?= agentgateway-system +HELM_DIR ?= ./helm +HELM_CHART_VERSION ?= v2.2.0 +HELM_VALUES_FILE ?= ./values.yaml +HELM_OCI_REGISTRY ?= cr.agentgateway.dev +HELM_OCI_NAMESPACE ?= charts +HELM_OCI_USERNAME ?= +HELM_OCI_PASSWORD ?= +HELM_CHART_REPO ?= oci://$(HELM_OCI_REGISTRY)/$(HELM_OCI_NAMESPACE)/$(HELM_APPLICATION_NAME) + +include ../_template/base.mk + +.PHONY: install-crds +install-crds: + @echo "Installing Gateway API CRDs..." + kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.0/standard-install.yaml + @echo "Installing agentgateway CRDs..." + helm upgrade -i --create-namespace \ + --namespace $(HELM_NAMESPACE) \ + --version $(HELM_CHART_VERSION) \ + agentgateway-crds oci://$(HELM_OCI_REGISTRY)/$(HELM_OCI_NAMESPACE)/agentgateway-crds + +.PHONY: install-all +install-all: install-crds install + +.PHONY: verify +verify: + @echo "Verifying agentgateway installation..." + kubectl get pods -n $(HELM_NAMESPACE) + kubectl get gatewayclass agentgateway diff --git a/src/agentgateway/README.md b/src/agentgateway/README.md new file mode 100644 index 0000000..7d4e58d --- /dev/null +++ b/src/agentgateway/README.md @@ -0,0 +1,98 @@ +# agentgateway + +## Introduction + +agentgateway is a cloud-native API gateway designed for AI workloads. It provides a Kubernetes-native way to manage traffic, secure APIs, and observe your AI services. Built on the Kubernetes Gateway API, agentgateway enables seamless integration with AI agents and services. + +## Prerequisites + +Before installing agentgateway, ensure you have: + +1. A Kubernetes cluster (1.25+) +2. `kubectl` installed +3. `helm` installed (3.8+ for OCI support) + +## Installation + +### Quick Install (includes CRDs) + +To install agentgateway with all required CRDs: + +```bash +make install-all +``` + +### Step-by-Step Install + +1. Install Gateway API CRDs: + +```bash +kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.0/standard-install.yaml +``` + +1. Install agentgateway CRDs: + +```bash +make install-crds +``` + +1. Install agentgateway: + +```bash +make install +``` + +## Usage + +After installation, verify the deployment: + +```bash +# Check if agentgateway pods are running +kubectl get pods -n agentgateway-system + +# Verify GatewayClass is created +kubectl get gatewayclass agentgateway + +# View agentgateway services +kubectl get svc -n agentgateway-system +``` + +## Configuration + +The default configuration includes: + +- Gateway controller for managing Gateway API resources +- Control plane components for configuration management +- Support for AI workload routing + +You can customize the installation by modifying `values.yaml` before running `make install`. + +## Gateway API + +agentgateway supports the Kubernetes Gateway API standard. You can create Gateway and HTTPRoute resources to configure routing: + +```yaml +apiVersion: gateway.networking.k8s.io/v1 +kind: Gateway +metadata: + name: my-gateway + namespace: agentgateway-system +spec: + gatewayClassName: agentgateway + listeners: + - name: http + protocol: HTTP + port: 80 +``` + +## Uninstall + +To uninstall agentgateway: + +```bash +make uninstall +``` + +## Documentation + +For more information, visit the [official documentation](https://agentgateway.dev/docs/kubernetes/latest/). diff --git a/src/agentgateway/README.zh.md b/src/agentgateway/README.zh.md new file mode 100644 index 0000000..d1e97b9 --- /dev/null +++ b/src/agentgateway/README.zh.md @@ -0,0 +1,98 @@ +# agentgateway + +## 简介 + +agentgateway 是一个专为 AI 工作负载设计的云原生 API 网关。它提供了一种 Kubernetes 原生的方式来管理流量、保护 API 和观测 AI 服务。agentgateway 基于 Kubernetes Gateway API 构建,可实现与 AI 代理和服务的无缝集成。 + +## 前置条件 + +在安装 agentgateway 之前,请确保您已具备: + +1. Kubernetes 集群 (1.25+) +2. 已安装 `kubectl` +3. 已安装 `helm` (3.8+ 以支持 OCI) + +## 安装 + +### 快速安装(包含 CRDs) + +要安装 agentgateway 及其所有必需的 CRDs: + +```bash +make install-all +``` + +### 分步安装 + +1. 安装 Gateway API CRDs: + + ```bash + kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.0/standard-install.yaml + ``` + +2. 安装 agentgateway CRDs: + + ```bash + make install-crds + ``` + +3. 安装 agentgateway: + + ```bash + make install + ``` + +## 使用 + +安装完成后,验证部署状态: + +```bash +# 检查 agentgateway pod 是否运行 +kubectl get pods -n agentgateway-system + +# 验证 GatewayClass 是否已创建 +kubectl get gatewayclass agentgateway + +# 查看 agentgateway 服务 +kubectl get svc -n agentgateway-system +``` + +## 配置 + +默认配置包括: + +- 用于管理 Gateway API 资源的网关控制器 +- 用于配置管理的控制平面组件 +- 支持 AI 工作负载路由 + +您可以在运行 `make install` 之前修改 `values.yaml` 来自定义安装。 + +## Gateway API + +agentgateway 支持 Kubernetes Gateway API 标准。您可以创建 Gateway 和 HTTPRoute 资源来配置路由: + +```yaml +apiVersion: gateway.networking.k8s.io/v1 +kind: Gateway +metadata: + name: my-gateway + namespace: agentgateway-system +spec: + gatewayClassName: agentgateway + listeners: + - name: http + protocol: HTTP + port: 80 +``` + +## 卸载 + +卸载 agentgateway: + +```bash +make uninstall +``` + +## 文档 + +更多信息请访问[官方文档](https://agentgateway.dev/docs/kubernetes/latest/)。 diff --git a/src/agentgateway/values.yaml b/src/agentgateway/values.yaml new file mode 100644 index 0000000..806247b --- /dev/null +++ b/src/agentgateway/values.yaml @@ -0,0 +1,72 @@ +# Default values for agentgateway +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# Controller configuration +controller: + image: + repository: ghcr.io/kgateway-dev/agentgateway + tag: v2.2.1 + pullPolicy: IfNotPresent + resources: + limits: + cpu: 1000m + memory: 1Gi + requests: + cpu: 100m + memory: 256Mi + # Enable experimental Gateway API features + extraEnv: + KGW_ENABLE_GATEWAY_API_EXPERIMENTAL_FEATURES: 'false' + +# Gateway proxy configuration +gatewayProxy: + image: + repository: ghcr.io/kgateway-dev/agentgateway-proxy + tag: v2.2.1 + pullPolicy: IfNotPresent + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 100m + memory: 128Mi + +# Service configuration +service: + type: LoadBalancer + httpPort: 80 + httpsPort: 443 + +# RBAC configuration +rbac: + create: true + +# Service account configuration +serviceAccount: + create: true + annotations: {} + +# Pod security context +podSecurityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + +# Security context for containers +securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: + - ALL + +# Node selector +nodeSelector: {} + +# Tolerations +tolerations: [] + +# Affinity +affinity: {} diff --git a/src/kgateway/Makefile b/src/kgateway/Makefile index c2c474f..3bf810e 100644 --- a/src/kgateway/Makefile +++ b/src/kgateway/Makefile @@ -2,7 +2,7 @@ HELM_RELEASE_NAME ?= kgateway HELM_APPLICATION_NAME ?= kgateway HELM_NAMESPACE ?= kgateway-system HELM_DIR ?= ./helm -HELM_CHART_VERSION ?= +HELM_CHART_VERSION ?= v2.2.0 HELM_VALUES_FILE ?= ./values.yaml HELM_OCI_REGISTRY ?= cr.kgateway.dev HELM_OCI_NAMESPACE ?= kgateway-dev/charts @@ -11,3 +11,22 @@ HELM_OCI_PASSWORD ?= HELM_CHART_REPO ?= oci://$(HELM_OCI_REGISTRY)/$(HELM_OCI_NAMESPACE)/$(HELM_APPLICATION_NAME) include ../_template/base.mk + +.PHONY: install-crds +install-crds: + @echo "Installing Kubernetes Gateway API CRDs..." + kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.0/standard-install.yaml + @echo "Installing kgateway CRDs..." + helm upgrade -i --create-namespace \ + --namespace $(HELM_NAMESPACE) \ + --version $(HELM_CHART_VERSION) \ + kgateway-crds oci://$(HELM_OCI_REGISTRY)/$(HELM_OCI_NAMESPACE)/kgateway-crds + +.PHONY: install-all +install-all: install-crds install + +.PHONY: verify +verify: + @echo "Verifying kgateway installation..." + kubectl get pods -n $(HELM_NAMESPACE) + kubectl get gatewayclass kgateway diff --git a/src/kgateway/README.md b/src/kgateway/README.md index c7def4c..078d777 100644 --- a/src/kgateway/README.md +++ b/src/kgateway/README.md @@ -4,22 +4,55 @@ kgateway is a cloud-native API gateway built on Envoy Proxy. It provides a Kubernetes-native way to manage traffic, secure APIs, and observe your services. Formerly known as Gloo Gateway, kgateway offers advanced routing capabilities, traffic management, and extensibility through WebAssembly (Wasm) filters. +## Prerequisites + +Before installing kgateway, ensure you have: + +1. A Kubernetes cluster (1.25+) +2. `kubectl` installed +3. `helm` installed (3.8+ for OCI support) + ## Installation -To install kgateway, run: +### Quick Install (includes CRDs) + +To install kgateway with all required CRDs: ```bash -make install +make install-all ``` +### Step-by-Step Install + +1. Install Kubernetes Gateway API CRDs: + + ```bash + kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.0/standard-install.yaml + ``` + +2. Install kgateway CRDs: + + ```bash + make install-crds + ``` + +3. Install kgateway: + + ```bash + make install + ``` + ## Usage -After installation, you can configure kgateway using Kubernetes Gateway API resources: +After installation, verify the deployment: ```bash # Check if kgateway pods are running kubectl get pods -n kgateway-system +# Verify GatewayClass is created +kubectl get gatewayclass kgateway + # View kgateway services kubectl get svc -n kgateway-system ``` diff --git a/src/kgateway/README.zh.md b/src/kgateway/README.zh.md index 168e68c..df3a8bc 100644 --- a/src/kgateway/README.zh.md +++ b/src/kgateway/README.zh.md @@ -4,22 +4,55 @@ kgateway 是一个基于 Envoy Proxy 的云原生 API 网关。它提供了一种 Kubernetes 原生的方式来管理流量、保护 API 和观测服务。kgateway 前身为 Gloo Gateway,提供高级路由功能、流量管理和通过 WebAssembly (Wasm) 过滤器的可扩展性。 +## 前置条件 + +在安装 kgateway 之前,请确保您已具备: + +1. Kubernetes 集群 (1.25+) +2. 已安装 `kubectl` +3. 已安装 `helm` (3.8+ 以支持 OCI) + ## 安装 -安装 kgateway: +### 快速安装(包含 CRDs) + +要安装 kgateway 及其所有必需的 CRDs: ```bash -make install +make install-all ``` +### 分步安装 + +1. 安装 Kubernetes Gateway API CRDs: + + ```bash + kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.0/standard-install.yaml + ``` + +2. 安装 kgateway CRDs: + + ```bash + make install-crds + ``` + +3. 安装 kgateway: + + ```bash + make install + ``` + ## 使用 -安装完成后,您可以使用 Kubernetes Gateway API 资源来配置 kgateway: +安装完成后,验证部署状态: ```bash # 检查 kgateway pod 是否运行 kubectl get pods -n kgateway-system +# 验证 GatewayClass 是否已创建 +kubectl get gatewayclass kgateway + # 查看 kgateway 服务 kubectl get svc -n kgateway-system ```