Skip to content

Commit

Permalink
docs: update extending-envoy-gateway.md to match the API Reference (#…
Browse files Browse the repository at this point in the history
…1725)

Update extending-envoy-gateway.md

Fixes #1724

Signed-off-by: Todor Boev <rinsvind@gmail.com>
  • Loading branch information
rinswind authored Jul 31, 2023
1 parent 9ba9103 commit a7354c9
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions docs/latest/design/extending-envoy-gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ An example configuration:
```yaml
apiVersion: config.gateway.envoyproxy.io/v1alpha1
kind: EnvoyGateway
extension:
extensionManager:
resources:
- group: example.myextension.io
version: v2
kind: OAuth2Filter
hooks:
post:
- Route
- VirtualHost
- HTTPListener
- Translation
xdsTranslator:
post:
- Route
- VirtualHost
- HTTPListener
- Translation
service:
host: my-extension.example
port: 443
Expand All @@ -78,7 +79,7 @@ If the extension wants Envoy Gateway to watch resources for it then the extensio
- `version`: the API version of the resource
- `kind`: the Kind of resource

The extension can configure the `extension.hooks` field to specify which hook points it would like to support. If a given hook is not listed here then it will not be executed even
The extension can configure the `extensionManager.hooks` field to specify which hook points it would like to support. If a given hook is not listed here then it will not be executed even
if the extension is configured properly. This allows extension developers to only opt-in to the hook points they want to make use of.

This configuration is required to be provided at bootstrap and modifying the registered extension during runtime is not currently supported.
Expand Down Expand Up @@ -157,7 +158,7 @@ The [Route][] level Hook provides a way for extensions to modify a route generat
Doing so allows extensions to configure/modify route fields configured by Envoy Gateway and also to configure the
Route's TypedPerFilterConfig which may be desirable to do things such as pass settings and information to ext_authz filters.
The Post Route Modify hook also passes a list of Unstructured data for the externalRefs owned by the extension on the HTTPRoute that created this xDS route
This hook is always executed when an extension is loaded that has added `Route` to the `EnvoyProxy.extensions.hooks.post`, and only on Routes which were generated from an HTTPRoute that uses extension resources as externalRef filters.
This hook is always executed when an extension is loaded that has added `Route` to the `EnvoyProxy.extensionManager.hooks.xdsTranslator.post`, and only on Routes which were generated from an HTTPRoute that uses extension resources as externalRef filters.

```go
// PostRouteModifyRequest sends a Route that was generated by Envoy Gateway along with context information to an extension so that the Route can be modified
Expand Down Expand Up @@ -195,7 +196,7 @@ message PostRouteModifyResponse {

The [VirtualHost][] Hook provides a way for extensions to modify a VirtualHost generated by Envoy Gateway before it is finalized.
An extension can also make use of this hook to generate and insert entirely new Routes not generated by Envoy Gateway.
This hook is always executed when an extension is loaded that has added `VirtualHost` to the `EnvoyProxy.extensions.hooks.post`.
This hook is always executed when an extension is loaded that has added `VirtualHost` to the `EnvoyProxy.extensionManager.hooks.xdsTranslator.post`.
An extension may return nil to not make any changes to the VirtualHost.

```protobuf
Expand All @@ -220,7 +221,7 @@ message PostVirtualHostModifyResponse {
### HTTP Listener Modification Hook

The HTTP [Listener][] modification hook is the broadest xDS modification Hook available and allows an extension to make changes to a Listener generated by Envoy Gateway before it is finalized.
This hook is always executed when an extension is loaded that has added `HTTPListener` to the `EnvoyProxy.extensions.hooks.post`. An extension may return nil
This hook is always executed when an extension is loaded that has added `HTTPListener` to the `EnvoyProxy.extensionManager.hooks.xdsTranslator.post`. An extension may return nil
in order to not make any changes to the Listener.

```protobuf
Expand Down Expand Up @@ -249,7 +250,7 @@ This allows for inserting clusters that may change along with extension specific
using custom bootstrap config which would be sufficient for clusters that are static and not prone to have their configurations changed.
An example of how this may be used is to inject a cluster that will be used by an ext_authz http filter created by the extension.
The list of clusters and secrets returned by the extension are used as the final list of all clusters and secrets
This hook is always executed when an extension is loaded that has added `Translation` to the `EnvoyProxy.extensions.hooks.post`.
This hook is always executed when an extension is loaded that has added `Translation` to the `EnvoyProxy.extensionManager.hooks.xdsTranslator.post`.

```protobuf
// PostTranslateModifyRequest currently sends only clusters and secrets to an extension.
Expand Down

0 comments on commit a7354c9

Please sign in to comment.