nomad
nomad copied to clipboard
Provide namespace / job / group / alloc_id to CNI plugins
To make it easier to write CNI plugins it would be great if nomad could provide namespace / job / group / alloc_id via CNI_ARGS to CNI plugins. While it is already possible to use the alloc id (but only when setting the namespace to '*') to query the nomad API and request this information, it would reduce the number of moving parts massively.
The namespace, job and group names are rather important if the CNI provides network policies, which could be nicely written using that information.
Kubernetes already provides the pod name and namespace via CNI_ARGS, so it is not like we are inventing something new here :) Also nomad allows to set similar information for docker containers which makes it easier for 3rd party tooling to do something with it -- why not also make it nicer for CNI. The possibilities are endless, for instance I could use it to update a DNS Server with the alloc ips etc… The changes required in nomad are probably minimal, the extra bytes in the CNI_ARGS will most certainly not hurt and it might make things easier for people trying to do something with CNI.
/cc @tgross