Skip to content

Allow configuration of traffic distribution policy for gateway services#48

Merged
domgoodwin merged 1 commit intomasterfrom
egress-operator-configure-traffic-distribution
Jun 27, 2025
Merged

Allow configuration of traffic distribution policy for gateway services#48
domgoodwin merged 1 commit intomasterfrom
egress-operator-configure-traffic-distribution

Conversation

@domgoodwin
Copy link
Copy Markdown
Contributor

We currently allowing setting topology aware routing (an annotation on services) to reduce cross AZ traffic, but this has lots of limitations and only works for deployments with lots of pods.

Instead lets allow the use of traffic distribution so we can configure service traffic to prefer (but fail back to not) traffic to stay with AZs - this means pods routing to the service of gateways will try and keep within AZ boundaries hopefully reducing cross AZ traffic.

Comment thread controllers/service.go

if es.Spec.ServiceTrafficDistribution != "" {
trafficDistribution := es.Spec.ServiceTrafficDistribution
serviceSpec.TrafficDistribution = &trafficDistribution
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you think it would be helpful to add some validation here for when traffic distribution has an unsupported value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My worry would be if k8s supports extra values in the future we have to also update it here and the failure mode even if we errored here is the same as the operator failing to sync a service manifest (it won't update the svc and logs errors)

@domgoodwin domgoodwin merged commit dcad64f into master Jun 27, 2025
1 check passed
@domgoodwin domgoodwin deleted the egress-operator-configure-traffic-distribution branch June 27, 2025 14:50
moabukar added a commit to moabukar/egress-operator that referenced this pull request Apr 8, 2026
The inline anonymous struct for TopologySpreadSkews in
ExternalServiceSpec causes controller-gen to crash with a nil
pointer dereference when running `make manifests`. Extracting it
to a named type resolves the panic.

This also regenerates the CRD manifest, which was out of date and
missing the topologySpreadSkews and serviceTrafficDistribution
fields added in monzo#47 and monzo#48.

Fixes monzo#49
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