-
Notifications
You must be signed in to change notification settings - Fork 101
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
DNS based cross Gslb communication #30
Conversation
408ffbb
to
ca2f5f5
Compare
* We need to exchange information between multiple Gslb instances which are deployed to different clusters * Instead of exposing k8s or any other form of API we can just rely on DNS itself * We expose only working IP addresses for specific Gslb as an A record for service `hostsz.$gslb.Name.$dnzZone` which is created automatically by the operator * The data we expose is totally non-sensitive so we simplify configuration requiring no service account tokens / tls certificates or similar for Gslb information exchange * External Gslb enabled clusters are specified as configuration environemnt variable in operator deployment and abstracted as `ohmyglb.extGslbClusters` value in operator helm chart * First and naive implementation of `roundRobin` Gslb strategy Example of this code working on local cluster ``` $ k -n test-gslb get dnsendpoints.externaldns.k8s.io -o yaml ... spec: endpoints: - dnsName: hostsz.test-gslb.example.com recordTTL: 30 recordType: A targets: - 172.17.0.2 - dnsName: app3.cloud.example.com recordTTL: 30 recordType: A targets: - 172.17.0.2 - 172.17.0.2 ... ``` Here we observe populates service `hostsz` entry and also extended target list for `app3.cloud.example.com` with `roundRobin` strategy (IPs are duplicates given the local testing scenario)
ca2f5f5
to
e435c5f
Compare
@ytsarev Given two clusters (A and B) with external Gslb enabled on both and one cluster (A) suffers network issues, what cleans up the records for Gslb on cluster A, so that no traffic is sent there. I.e. If Gslb controller cannot clean up due to catastrophic failure or network issues, how does garbage collection work so as to prevent stale records for the affected cluster (which for arguments sake, cannot accept any ingress traffic)? |
@donovanmuller So as a further implementation steps we need to think about:
Speaking of 2) i think we can remove special entry of |
* Register per Gslb Ingress host `localtargets.*` instead of global `hostsz` * `localtargets.*` A record is getting populated only if backend service is healthy * Make Gslb to return healthy records of *external* Gslb even if associated service in own cluster is `Unhealthy/NotFound`
@donovanmuller I've implemented 2) in 2bcff9f please check it out. Not yet sure if we need 1) (scheduled reconciliation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@ytsarev understood, I like the updated implementation 👍 |
instances which are deployed to different clusters
can just rely on DNS itself
as an A record for service
hostsz.$gslb.Name.$dnzZone
which is created automatically by the operator
configuration requiring no service account tokens / tls certificates
or similar for Gslb information exchange
environemnt variable in operator deployment and abstracted
as
ohmyglb.extGslbClusters
value in operator helm chartroundRobin
Gslb strategyExample of this code working on local cluster
Here we observe populates service
hostsz
entry and alsoextended target list for
app3.cloud.example.com
withroundRobin
strategy(IPs are duplicates given the local testing scenario)