Skip to content

Commit

Permalink
docs: more comment about generated resources in API (#294)
Browse files Browse the repository at this point in the history
**Commit Message**

This adds additional doc comments on AIGatewayRoute resource 
about which k8s resources will be created by Envoy AI Gateway.

**Related Issues/PRs (if applicable)**

Closes #258

---------

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
  • Loading branch information
mathetake authored Feb 6, 2025
1 parent 10a41d2 commit d6c8c1d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 6 deletions.
17 changes: 15 additions & 2 deletions api/v1alpha1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,21 @@ import (
// on the output schema of the AIServiceBackend while doing the other necessary jobs like
// upstream authentication, rate limit, etc.
//
// AIGatewayRoute generates a HTTPRoute resource based on the configuration basis for routing the traffic.
// The generated HTTPRoute has the owner reference set to this AIGatewayRoute.
// For Advanced Users: Envoy AI Gateway will generate the following k8s resources corresponding to the AIGatewayRoute:
//
// - Deployment, Service, and ConfigMap of the k8s API for the AI Gateway filter.
// The name of these resources are `ai-eg-route-extproc-${name}`.
// - HTTPRoute of the Gateway API as a top-level resource to bind all backends.
// The name of the HTTPRoute is the same as the AIGatewayRoute.
// - EnvoyExtensionPolicy of the Envoy Gateway API to attach the AI Gateway filter into the HTTPRoute.
// The name of the EnvoyExtensionPolicy is `ai-eg-route-extproc-${name}` which is the same as the Deployment, etc.
// - HTTPRouteFilter of the Envoy Gateway API per namespace for automatic hostname rewrite.
// The name of the HTTPRouteFilter is `ai-eg-host-rewrite`.
//
// All of these resources are created in the same namespace as the AIGatewayRoute. Note that this is the implementation
// detail subject to change. If you want to customize the default behavior of the Envoy AI Gateway, you can use these
// resources as a reference and create your own resources. Alternatively, you can use EnvoyPatchPolicy API of the Envoy
// Gateway to patch the generated resources. For example, you can insert a custom filter into the filter chain.
type AIGatewayRoute struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,21 @@ spec:
on the output schema of the AIServiceBackend while doing the other necessary jobs like
upstream authentication, rate limit, etc.
AIGatewayRoute generates a HTTPRoute resource based on the configuration basis for routing the traffic.
The generated HTTPRoute has the owner reference set to this AIGatewayRoute.
For Advanced Users: Envoy AI Gateway will generate the following k8s resources corresponding to the AIGatewayRoute:
- Deployment, Service, and ConfigMap of the k8s API for the AI Gateway filter.
The name of these resources are `ai-eg-route-extproc-${name}`.
- HTTPRoute of the Gateway API as a top-level resource to bind all backends.
The name of the HTTPRoute is the same as the AIGatewayRoute.
- EnvoyExtensionPolicy of the Envoy Gateway API to attach the AI Gateway filter into the HTTPRoute.
The name of the EnvoyExtensionPolicy is `ai-eg-route-extproc-${name}` which is the same as the Deployment, etc.
- HTTPRouteFilter of the Envoy Gateway API per namespace for automatic hostname rewrite.
The name of the HTTPRouteFilter is `ai-eg-host-rewrite`.
All of these resources are created in the same namespace as the AIGatewayRoute. Note that this is the implementation
detail subject to change. If you want to customize the default behavior of the Envoy AI Gateway, you can use these
resources as a reference and create your own resources. Alternatively, you can use EnvoyPatchPolicy API of the Envoy
Gateway to patch the generated resources. For example, you can insert a custom filter into the filter chain.
properties:
apiVersion:
description: |-
Expand Down
19 changes: 17 additions & 2 deletions site/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,23 @@ on the output schema of the AIServiceBackend while doing the other necessary job
upstream authentication, rate limit, etc.


AIGatewayRoute generates a HTTPRoute resource based on the configuration basis for routing the traffic.
The generated HTTPRoute has the owner reference set to this AIGatewayRoute.
For Advanced Users: Envoy AI Gateway will generate the following k8s resources corresponding to the AIGatewayRoute:


- Deployment, Service, and ConfigMap of the k8s API for the AI Gateway filter.
The name of these resources are `ai-eg-route-extproc-${name}`.
- HTTPRoute of the Gateway API as a top-level resource to bind all backends.
The name of the HTTPRoute is the same as the AIGatewayRoute.
- EnvoyExtensionPolicy of the Envoy Gateway API to attach the AI Gateway filter into the HTTPRoute.
The name of the EnvoyExtensionPolicy is `ai-eg-route-extproc-${name}` which is the same as the Deployment, etc.
- HTTPRouteFilter of the Envoy Gateway API per namespace for automatic hostname rewrite.
The name of the HTTPRouteFilter is `ai-eg-host-rewrite`.


All of these resources are created in the same namespace as the AIGatewayRoute. Note that this is the implementation
detail subject to change. If you want to customize the default behavior of the Envoy AI Gateway, you can use these
resources as a reference and create your own resources. Alternatively, you can use EnvoyPatchPolicy API of the Envoy
Gateway to patch the generated resources. For example, you can insert a custom filter into the filter chain.

_Appears in:_
- [AIGatewayRouteList](#aigatewayroutelist)
Expand Down

0 comments on commit d6c8c1d

Please sign in to comment.