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

Gw2 externaltrafficpolicy #10386

Closed

Conversation

kevin-shelaga
Copy link
Contributor

Description

When using the Kubernetes Gateway API, the provisioned proxy service external traffic policy is now configurable via the GatewayParameters fields spec.kube.service.externalTrafficPolicy

This values can also be set on the default GatewayParameters during install/upgrade using the Helm value kubeGateway.gatewayParameters.glooGateway.service.externalTrafficPolicy

API changes

Added fields to GatewayParameters:

spec.kube.service.externalTrafficPolicy

Code changes

Update gw params to expose external traffic policy
Add test

Context

Fixes #9879

Isers need to be able to change the external traffic policy so that source client IPs are preserved for features like WAF and ext auth.

Testing steps

helm unit tests
deployer unit tests
deployer e2e test

Notes for reviewers

First time making gw2 changes - let me know what i did wrong

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

sheidkamp and others added 27 commits November 22, 2024 00:23
Co-authored-by: Jenny Shu <28537278+jenshu@users.noreply.github.com>
Co-authored-by: Sam Heilbron <SamHeilbron@gmail.com>
Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io>
Co-authored-by: Sam Heilbron <SamHeilbron@gmail.com>
Co-authored-by: Nathan Fudenberg <nathan.fudenberg@solo.io>
When only Kube GW proxies are present, we still rely on the edge translator_syncer for extension syncing.
The edge translator will mark Upstreams & UpstreamGroups as Accepted
then perform xds translation where status may be changed to e.g. Rejected if there is an error.

However, in the case where there are no edge proxies, 
translation doesn't actually occur, so any actual errors on the Upstream are never encountered,
thus the status is never set to Rejected.
We end up in a scenario where the Kube GW syncer (correctly) reports Rejected status
while the Edge syncer reports Accepted and they will fight each other indefinitely.

This changes the edge translator_syncer to no longer mark Upstream[Group]s as Accepted unless it will also perform translation.

track obj status in krt collections
    
the status reporter compares the desired status with the
existing status in the solo-kit object to determine if it
should actually UPDATE the resource.

the current proxy_syncer will do a once per second status sync
and relies on this status comparison to be functional to prevent
endless object UPDATEs.

this commit fixes the solo-kit objects (really wrappers) in the
krt collections to contain the status so an accurate comparison
can take place.
Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io>
Co-authored-by: Nathan Fudenberg <nathan.fudenberg@solo.io>
Co-authored-by: Art <artberger@users.noreply.github.com>
Co-authored-by: Omar Hammami <58956785+puertomontt@users.noreply.github.com>
Co-authored-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Signed-off-by: Shashank Ram <shashank.ram@solo.io>
Co-authored-by: Sam Heilbron <SamHeilbron@gmail.com>
Co-authored-by: Nathan Fudenberg <nathan.fudenberg@solo.io>
Co-authored-by: Nathan Fudenberg <nathan.fudenberg@solo.io>
Co-authored-by: changelog-bot <changelog-bot>
Co-authored-by: Seth Heidkamp <61526534+sheidkamp@users.noreply.github.com>
Co-authored-by: Nadine Spies <17709352+Nadine2016@users.noreply.github.com>
Co-authored-by: Nathan Fudenberg <nathan.fudenberg@solo.io>
…ces (#10412)

Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io>
Co-authored-by: Nathan Fudenberg <nathan.fudenberg@solo.io>
Co-authored-by: changelog-bot <changelog-bot>
Co-authored-by: Nathan Fudenberg <nathan.fudenberg@solo.io>
@kevin-shelaga kevin-shelaga deleted the gw2-externaltrafficpolicy branch November 28, 2024 12:18
@kevin-shelaga kevin-shelaga restored the gw2-externaltrafficpolicy branch November 28, 2024 12:19
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.

Ability to set "externalTrafficPolicy" in "GatewayParameters"