Nomad: Implement dynamic ports in rkt driver

Created on 17 Mar 2016  路  8Comments  路  Source: hashicorp/nomad

As of v0.3.1, the rkt driver does not support dynamic port allocation. Per the documentation:

This can lead to port conflicts and as such, this driver is being marked as experimental and should be used with care.

I believe this is stunting further adoption of rkt with Nomad.

themdriverkt typenhancement

All 8 comments

That's true. Sorry it took this long, I am hoping to get this working over the weekend.

Has there been any progress on this? I'd also love to have this functionality.

Sorry for being so late on this. Unfortunately, I did not have a chance to work on this since a few months.

I could not find a way to expose arbitrary ports in rkt. From what I understand, ports have to be defined in the app image and then they can be exposed in the CLI. So, we cannot define a port randomly and map it 1:1 (unless there is a way which is not obvious from the docs). Given an app image with a port defined, we can do this:

  1. Read the image manifest to get the port definitions
  2. If those port names are in the dynamic ports config in the Nomad job, map the ports 1:1 using the rkt CLI
  3. Construct the env variables and put those in the container
    Will that work for you guys?

I opened a bug in rkt asking about this: https://github.com/coreos/rkt/issues/2801

There's progress on this in #1616.

As https://github.com/hashicorp/nomad/pull/1616 is merged and closed, does this means that dynamic ports is supported by rkt driver?

@minhdanh Yes! Sorry for not updating this ticket. I'd love to get some confirmation (other than my own testing) that it's working the way people need it to. I'm closing this issue, but if you get a chance to try out the 0.5 release candidate please feel free to file new issues or ping me in gitter: https://gitter.im/hashicorp-nomad/Lobby

So I think the document may also need updated: https://www.nomadproject.io/docs/drivers/rkt.html

@minhdanh Ah, thanks! I forgot to update that big warning at the top. Luckily the new features are documented: https://www.nomadproject.io/docs/drivers/rkt.html#networking

I'll get that warning updated ASAP.

Was this page helpful?
0 / 5 - 0 ratings