mholt / caddy-dynamicdns

Caddy app that keeps your DNS records (A/AAAA) pointed at itself.
Apache License 2.0
250 stars 25 forks source link

Add HA support. #48

Open blmhemu opened 1 year ago

blmhemu commented 1 year ago

Example Scenario Two caddy instances on different hosts with ips 11.11.11.11 and 11.11.11.12 . Need to insert DNS records for both the IPs (for dns load balancing).

Notes I understand I might be opening a can of worms (multi instance coordination, distributed systems etc.). But thought of giving it a shot.

mholt commented 1 year ago

Hoo boy.

Current design of this plugin is only for simple deployments.

We could discuss a design that enables use in HA environments though.

blmhemu commented 1 year ago

I was thinking along the lines of serf + keepalived Serf: To infect membership details. Keepalived (or a version of keepalived) to select the "active" instance (in say a 3 member HA deployment) which can check for dns entries and place them.

I realize, I might be treading in the territory of consul (serf + raft).

francislavoie commented 1 year ago

I think it would probably be best if you fork this plugin to implement this yourself as a redesign. I don't think we'll have time to tackle this kind a project, and I doubt it's a feature we'll every need ourselves so there's not much value in us spending time on it (unless it's sponsored/paid for).

mholt commented 1 year ago

Yeah, that seems like a lot of work. Forking the project to implement this seems like a good approach, and then if you like the implementation you can make a PR and we can decide whether it's a good fit to be merged in.