this post was submitted on 17 Nov 2023
0 points (50.0% liked)

Homelab

380 readers
9 users here now

Rules

founded 1 year ago
MODERATORS
 

Hi all...

So I've moved to Docker Swarm to test it in comparison to K3s. I'm not a huge fan of the complexity of K3s, so I thought I'd give Docker Swarm a shot.

The only issue I have so far is this....

I have 3 manager nodes and 3 worker nodes. However, I have my DNS server pointing the hosted services to the one manager node that hosts NGINX for reverse proxy. My problem is, when one of the manager nodes goes down, the next one takes over, but all the services are still pointing to the first manager node's IP for NGINX.

NGINX does move to the other manager, but without DNS pointing to the right IP, it's useless. I really don't want to have to go change the IP in my DNS server anytime this happens and that defeats the purpose of multiple managers to create HA.

So, what am I doing wrong here?

top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 0 points 11 months ago (1 children)

You are not using the proper tools for your need.

To do HA here, you need to add something like KeepAlived. Install it on all of your manager nodes. Once configured, it will create a VIP that will move from one manager to the other according to which one is up and marked as the favorite one. You then point your dns clients to that VIP instead of the actual IP of any of your manager.

HAProxy can do some load balancing as well (TCP or HTTP) but here, Keepalived is what you need.

[โ€“] [email protected] 0 points 11 months ago

Thank you! I knew I was missing something!