Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Geo DNS based load balancing policy #219

Closed
3 tasks done
maleck13 opened this issue May 25, 2023 · 3 comments
Closed
3 tasks done

Geo DNS based load balancing policy #219

maleck13 opened this issue May 25, 2023 · 3 comments
Assignees
Labels

Comments

@maleck13
Copy link
Contributor

maleck13 commented May 25, 2023

What

We currently only support Round Robin / Even weighted load balancing. We want to support GEO based load balancing. The idea here is that the DNS for a given listener will be setup based on geo metadata added to the managedcluster resource.

Initially we will focus on supporting continents but we should also consider what it means to support more fine grained options such as countries.

Example EU (Europe) NA (North America)

We will also need to support defining a default for when a request falls outside of a defined geo region

Use Cases

As a gateway administrator setting up multiple instances of a gateway that are deployed to clusters in different geographic regions, I want to be able to specify that traffic coming into these gateways should be load balanced based on where the request originated. Additionally I want to be able to specify  default / fall back location to cover the case where a request falls outside a specified geo location

Proposal

Only a single DNSPolicy can be applied and we should use the creation timestamp as the decider with the oldest winning
https://gateway-api.sigs.k8s.io/references/policy-attachment/#conflict-resolution

This work should build on top of what was done with GLBC in the past to support this. Work originally done by @MNairn

One option is to support a set of attributes on the ManagedCluster resource

kuadrant.io/attribute-geo-contienent: EU

kind: DNSPolicy
spec:
  targetRef:
     ....  Gateway
   routing:
     strategy: GEO # default even weighting
     default: EU

Add a reference to a DNSPolicy to the DNSRecord resource and DNSRecord reconciler follows that to figure out how to create the records. This reference should be a part of the status or an ownerref

using an owner ref may allow us to get events via the following mechanism

Watches(&source.Kind{Type: &v1alpha1.DNSRecord{}}, &handler.EnqueueRequestForOwner{
			IsController: false,
			OwnerType:    &v1alpha1.DNSPolicy{},
		}). 
  • Unit / integration tests

This implementation is for AWS only currently and expand based on the below investigation with follow up issues

@maleck13 maleck13 converted this from a draft issue May 25, 2023
@maleck13 maleck13 changed the title Investigate adding configurable DNS based load balancing policy Configurable DNS based load balancing policy May 25, 2023
@maleck13 maleck13 changed the title Configurable DNS based load balancing policy Geo DNS based load balancing policy May 25, 2023
@maleck13 maleck13 added the mvp label May 25, 2023
@maleck13
Copy link
Contributor Author

In a future iteration, we may also look to support "overriding" the gateway policy with a policy that directly targets a DNSRecord resource

@maleck13
Copy link
Contributor Author

@mikenairn mikenairn self-assigned this May 30, 2023
@mikenairn mikenairn moved this from Todo to In Progress in Multicluster Gateway Controller May 30, 2023
@mikenairn mikenairn moved this from In Progress to Todo in Multicluster Gateway Controller May 31, 2023
@mikenairn
Copy link
Member

Dropped this out of the iteration for now since we really want the policy stuff to land before taking this on. #221

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Development

No branches or pull requests

2 participants