-
Notifications
You must be signed in to change notification settings - Fork 19
[WIP] Attach lxc containers to lxcbr0 by configuring a new network_mode parameter #13
Conversation
Driver can attach a container to lxcbr0 now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@towe75 I left some comments in your other PR about making the CLA bot happy.
For this PR:
- Can we add documentation to the README for what requirements the bridge networking mode imposes on clients? It looks like this at least assumes that the
lxcbr0
is already set up. - While other drivers have this same
network_mode
config, in Nomad 0.10 we have support for CNI plugins, including configuring network namespaces at the task group level (so we can share a network namespace even between different task drivers!). Do you think you'd be interested in trying to get the LXC driver to be able to support that networking mode as well?
@tgross about lxcbr0: i'll add a section to the README, also a parameter for the bridge name might be a good idea. Regarding CNI: i will make it configurable in my nomad-driver-podman soon. AFAIK LXC does not use CNI at all, although it's possible to share the network namespace with other containers and this plugin could expose this feature in a nomad group, if somebody needs it. |
Sounds good on that, @towe75. Looks like there's a merge conflict now that the other PR has been merged. |
@tgross merge conflict is solved. |
@tgross can we merge this PR and have a release for lxc driver? I'm using |
Ok, we're going to merge this as-is and cut a new tag for it. |
A new driver parameter "network_mode" switches the behavior of the containers network interface.
The default value "bridge", will attach the container to the standard "lxcbr0" bridge. A value of "host" will instead share the network with the host, like it was in previous versions.
It's also possible to set the "network_mode" parameter within the task driver config. It simply overrides the global driver parameter and thus allows a different mode for specific containers.