OJFord / ipvs-txt-lb

IPVS load balancer sourcing servers from a TXT record
MIT License
7 stars 2 forks source link

Use SRV records instead? #1

Open OJFord opened 3 years ago

OJFord commented 3 years ago

It was pointed out to me that a SRV record would be appropriate here, and perhaps better suited than TXT if for nothing more than being well-defined and having pretty much the right semantics.

It's.. unfortunate then that I named this ipvs-txt-lb! Well, I thought I'd leave an issue here to say I'm aware of it, and for any strong feelings to be noted below. Especially interested if anyone's using this and has a particular use for them being in SRV as opposed to TXT, (currently necessitating ~duplicates) or a problem caused by them being TXT, etc., beyond aesthetic tidiness.

(I suppose checking both, or having it configurable, would also be an option.)

OJFord commented 2 years ago

Add this as an option.

Infer it from _.+\._tcp\..+ addresses, or else a --srv flag (and disable inference with --no-srv).

Should pick the highest priority results from dig ... SRV +short, and add to ipvsadm with their --weights.

I already implemented in python with srvlookup for another purpose - but don't want to add the dependency (on python and a package) here; since ipvsadm itself handles the weighting anyway it should be pretty trivial to sort on priority, select the top, and feed in.