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

DFP proposal #10596

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

DFP proposal #10596

wants to merge 1 commit into from

Conversation

yuval-k
Copy link
Contributor

@yuval-k yuval-k commented Feb 9, 2025

very rough draft - mainly to get early feedback.

Adding dynamic forward proxy support.

Notes:

  • This uses envoy's new sub cluster config that seems more ergonomic to use, and has more features. The old dns cache would make envoy NACK if the config on the listener is different than the config on the cluster.
  • Not exposing any settings. we use the defaults, until we get feedback otherwise to simplify the API.

Unlike the previous impl that represents DFP as a route action, this one represents it as an upstream type. This makes more sense for the k8s-GW-API, as we cannot add custom route actions.

For every DFP upstream we add a DFP cluster and a filter on the relevant filter chain.

if !p.needFilter[fc.FilterChainName] {
return nil, nil
var ret []plugins.StagedHttpFilter
if p.needAwsFilter[fc.FilterChainName] {
Copy link
Contributor

Choose a reason for hiding this comment

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

does it matter in which order we add the aws / dfp filters?

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 think so; DFP filter only takes affect on DFP cluster. aws filter won't be active for those.. so they should never work at the same time.

Comment on lines +92 to +93
needAwsFilter map[string]bool
neededDfpFilter map[string]map[string]*envoydfp.FilterConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a comment on what the keys/values are?

}
var anyCluster anypb.Any
err := anypb.MarshalFrom(&anyCluster, c, proto.MarshalOptions{Deterministic: true})
// error should never happen here. panic?
Copy link
Contributor

Choose a reason for hiding this comment

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

can we have processDFPRoute/processDFPCluster return an error instead?

@@ -62,7 +64,8 @@ func (d *upstreamDestination) Equals(in any) bool {
}

type UpstreamIr struct {
AwsSecret *ir.Secret
AwsSecret *ir.Secret
dfpFilterConfig *envoydfp.FilterConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

should this field be exported?

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 don't think so, this struct is the IR (internal representation) that is only used inside this plug-in, and is meant to remain opaque to the rest of the system.

Copy link
Contributor

Choose a reason for hiding this comment

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

in that case should awsSecret also be private?

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.

2 participants