public ip address changes

47 views
Skip to first unread message

enya...@peernova.com

unread,
Apr 23, 2018, 6:53:22 PM4/23/18
to Nomad

Hello

I want to deploy a web server (open to the Internet) using Nomad/docker (to simplify, a single instance). 

The thing is that every time I stop/start it, Nomad may choose a different client to allocate the container, and each client has a different public ip address. This is a problem because i need to update my DNS server with the new address every time the client changes.

What's the best way to address this?

Is there something similiar to Kubernetes service object?

Thank you!

Edson.

Yan Su

unread,
Apr 23, 2018, 10:51:36 PM4/23/18
to nomad...@googlegroups.com
Hi,

Yes this is the expected behaviour. There are 2 solution:

- pin the task group to specific node via constraints
- setup a fronting proxy to forward traffic, you'll need to setup consul and use service stanza. There are several load balancers with native consul support, like fabio, traefik. Or you can use nginx with consul-template. Istio and linkerd are probably way too complicated for your requirement.

The latter one is the best way if you have more service that needs to be exposed to the internet, however the first one is the simplest solution with no dependencies

Yan.

Shantanu Gadgil

unread,
Apr 24, 2018, 10:14:06 PM4/24/18
to Nomad
gobetween is also an L4 proxy.
(gobetween.io)

Justin DynamicD

unread,
Apr 25, 2018, 1:37:19 PM4/25/18
to Nomad
Throwing in my support behind using a load balancer to solve this issue.

I'd just like to point out it ends up unlocking all sorts of other behaviors as well that will be of benefit.  For example, if you know the load balancer will always present the container on port 443, you no longer have to concern yourself with the port assigned by Nomad.  This will make packing containers much more efficient and allow you to cut the node count because you don't have to worry about containers competing over the same port.  This gets really valuable if you start looking at things like Prometheus which can consume TONS of ports in it's quest to gather metrics.

Regards,
Justin
Reply all
Reply to author
Forward
0 new messages