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

RFC : TXT DNS discovery #9128

Closed
hexfusion opened this issue Jan 10, 2018 · 6 comments
Closed

RFC : TXT DNS discovery #9128

hexfusion opened this issue Jan 10, 2018 · 6 comments

Comments

@hexfusion
Copy link
Contributor

hexfusion commented Jan 10, 2018

TXT based DNS discovery allows for discovery based on TXT record. The token name will be used as the TXT and A record name. This not only binds the cluster to a specific domain but also uses the token name to anchor the discovery process.

The TXT record could define various key/value pairs but scheme and client/server port are required.

At this point I am curious if this could be useful alternative to SRV discovery. Any input is welcome.

Create DNS TXT records

; TXT record
etcd-cluster-1                300 IN  TXT  "scheme=https" "server=2379" "client=2380"
$ dig +short -t txt etcd-cluster-1.sub.hexfusion.local
"scheme=https" "server=2379" "client=2380"
; A records
$ORIGIN sub.hexfusion.local.

infra0     IN       A      10.0.1.10
infra1     IN       A      10.0.1.11
infra2     IN       A      10.0.1.12

etcd-cluster-1   IN       A      10.0.1.10
etcd-cluster-1   IN       A      10.0.1.11
etcd-cluster-1   IN       A      10.0.1.12
$ dig +short etcd-cluster-1.sub.hexfusion.local
10.0.1.10
10.0.1.11
10.0.1.12
;PTR Record IP address to HostName
10     IN      PTR    infra0.sub.hexfusion.local.
11     IN      PTR    infra1.sub.hexfusion.local.
12     IN      PTR    infra2.sub.hexfusion.local.
$ dig +short -x 10.0.1.10
infra0.sub.hexfusion.local.

Bootstrap the etcd cluster using DNS

$ etcd --name infra0 \
--discovery-txt sub.hexfusion.local \
--initial-advertise-peer-urls http://10.0.1.10:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.10:2379 \
--listen-client-urls http://10.0.1.10:2379 \
--listen-peer-urls http://10.0.1.10:2380
$ etcd --name infra1 \
--discovery-txt sub.hexfusion.local \
--initial-advertise-peer-urls http://10.0.1.11:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.11:2379 \
--listen-client-urls http://10.0.1.11:2379 \
--listen-peer-urls http://10.0.1.11:2380
$ etcd --name infra2 \
--discovery-txt sub.hexfusion.local \
--initial-advertise-peer-urls http://10.0.1.12:2380 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster-state new \
--advertise-client-urls http://10.0.1.12:2379 \
--listen-client-urls http://10.0.1.12:2379 \
--listen-peer-urls http://10.0.1.12:2380
@hexfusion
Copy link
Contributor Author

@gyuho @xiang90 does this make any sense? The only thing I find of interest here is the possible ability to add metadata in the TXT record about the cluster vs SRV. The downside would be standardizing/validating the format of the metadata records. So supporting could be more "work". But perhaps it could facilitate more complex bootstrapping workflows. Workflows perhaps yet to be identified.

@hexfusion
Copy link
Contributor Author

I will work on a PR if you find the basic concept reasonable.

@xiang90
Copy link
Contributor

xiang90 commented Jan 23, 2018

the concept looks fine to me. but do we hear any user wants this feature? i want some validation on this use case before commit to it.

@hexfusion
Copy link
Contributor Author

Valid point no user has commented. As the idea is valid, please leave this open for a while and we can see if it gets any comment.

@xiang90
Copy link
Contributor

xiang90 commented Jan 23, 2018

@hexfusion sure. we will leave this open. users can +1 on this issue if they see a fit.

@xiang90 xiang90 added this to the unplanned milestone Jan 23, 2018
@stale
Copy link

stale bot commented Apr 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 7, 2020
@stale stale bot closed this as completed Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants