Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

design 10574: transformations #10689

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nfuden
Copy link
Contributor

@nfuden nfuden commented Feb 24, 2025

Adds a proposal to allow for access log enrichment via headers and the ability to make comlex substitutions to headers on a request/response.

Current idea is to end up with a repo structure along the lines of this

Co-authored-by: Jenny Shu <[email protected]>
design/10574.md Outdated


## Alternatives
Port the existing Transformation from the old project and figure out how to migrate the custom envoy to github actions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

migrate the custom envoy to github actions

can you clarify what this means? i.e. getting CI for a custom envoy build working?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the update better answer?


## Open Questions
What is the timeline to removal of the current extended envoy image.
How do we want to handle route level overrides.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know if upstream has plans for it?; otherwise check if using the composite filter solves it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see it currently see a reference to route level configuration but i also see that filter registration factory is delegated to the dynamic module implementation so may try something out.

@nfuden nfuden enabled auto-merge February 25, 2025 01:23
@nfuden nfuden disabled auto-merge February 25, 2025 01:23
// +listMapKey=name
// +kubebuilder:validation:MaxItems=16
Add []HeaderTransformation `json:"add,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for completeness should we also have remove?

* Allow for mutations that are based on the contents of the request / response
* Have transformations support be stabley defined and not require a network hop
* Have an opinionated api to keep functionality be locked to transforming envoy constructs such as filter state, headers, body, trailers and metadata
* Keep all kgateway implementation specifics in kgateway repository.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how common is the use case of using values from the body for routing? if its common, should we support it at the first stage? (i'm ok deferring this, if you think that's ok)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience its only used a small portion of the time.

type MetadataTransformation struct {
// +required
Namespace string `json:"name,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i assume this is envoy dynamic-metadata filter namespace, not k8s namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. In my opinion having the policy have a nested construct that has the word metadata in it made the field of Namespace feel better as it doesnt stutter but am happy to change it if people feel that having the disambiguation would be nicer.

* Allow for mutations that are based on the contents of the request / response
* Have transformations support be stabley defined and not require a network hop
* Have an opinionated api to keep functionality be locked to transforming envoy constructs such as filter state, headers, body, trailers and metadata
* Keep all kgateway implementation specifics in kgateway repository.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify: this means the rust code would live in-tree instead of a dedicated repo, right? That would be consistent with the direction we wanted to take with the ext-proc implementation needed by the AI functionality (afaik).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. I dont want to have to look multiple places for code that makes decisions in the gateway

### Goals
* Allow for extraction of data from a header and place it in dynamic metadata or filter state such that it can be pulled into access logs
* Allow for mutations that are based on the contents of the request / response
* Have transformations support be stabley defined and not require a network hop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not blocking: s/stabely/stably?

Just for my own edification, the network hop here is alluding to doing this all via native (i.e. compiled?) envoy filters vs. having to call out to external components, e.g. custom ext-authz servers for authn/authz flows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically why we should make this a first class citizen rather than say just ask users to build their own ext proc servers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants