-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Expose contents of DriverNetwork via API #3285
Comments
I'm afraid - but uncertain - the complexity of this implementation will outweigh its benefits vs its workaround. Use case / WorkaroundAs far as I can tell - and please correct me I'm wrong - this is to avoid having to register services in Consul for things which aren't actually services. For example if Future workaround: lifecycle pluginInstead of exposing this data for consumption we could pass it to lifecycle plugins ... once those exist. That seems like the ideal place to manage firewall rules if the plugins can acquire credentials external from the task invoking them -- as I would assume allow tasks to manipulate firewall rules directly kind of defeats the point. ImplementationThe complexity I'm worried about is that we really expose very little task runtime information from allocations. I think this is it:
|
I'm afraid the workaround doesn't actually work though, atleast on So to actually do this, you would have to rebuild all container images to expose atleast a single port. Not so much a big deal for internal images, but problematic if you want to use publicly available images. I'll just add that I had missed the |
Aha! That makes sense and is a big deal.
After discussing this with @dadgar I think we should hold off on this for now. We'd like to expose all of the metadata generated by drivers somehow, and it will be easiest to pull that off when we refactor the client<->driver interactions prior to adding plugin support. I'm afraid adding a one off for networks now would complicate maintenance and backward compat. |
That makes sense @schmichael . I'll close this for now, since it will be subsumed by the more general mechanism later on. Thanks for considering it. |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Both the Docker and rkt(with #3256) expose a DriverNetwork structure to Nomad. The DriverNetwork structure can be used to get the actual network address of the container, which is very useful when used in container networking solutions.
Currently this data is only exposed when Nomad performs Consul service registration, but the data is potentially relevant to any allocation.
I therefore propose that the DriverNetwork contents be exposed via the
/v1/allocation/:id
endpoint and potentially the/v1/allocations
endpoint as well. This would allow external systems to monitor the DriverNetwork IP adresses of all active allocations in the Nomad cluster via blocking queries. My personal use case is automatically configuring firewalls and network policies between containers running under the rkt driver. The Consul service discovery mechanism is not really useful in this case, because I need to know about all endpoints at both ends of all connections, even if a given job exposes no services itself(e.g. it updates a database).I would be up for implementing this, but I would need some pointers as to where to best place the data.
BR.
The text was updated successfully, but these errors were encountered: