Nomad Docker job with macvlan networking has port collisions

Board,

Working with nomad and Consul, loving every bit of it. Looking to use macvlan on my nomad clients, all is well with docker jobs getting unique IPs from the docker networks. My issue is that nomad fails deployments with: Dimension network: reserved port collision

I would expect this if I was relying on the nomad-client host network interface but I am not, each of my dockers is getting a unique IP and therefore should not have any port collisions.

Is there a way to work around this? It seems that nomad still registers the job and allocations as on the nomad-client host network:port which is where my issue seems to be stemming from.

Thanks in advance,

db

1 Like

Board

I think I found the reason for this conflict. I was continuing to set resources in the job which were host specific. Removing these stanza’s resolved my collision issue.

Thanks,

db

just curious, what was the job spec which eventually worked?

When using macvlan, you simply do not define any resources { network { stanzas. This will allow the container to get an address from the macvlan network and be wide open to the world on any port. The host essentially does not care.