Nomad has built-in support for scheduling compute resources such as CPU, memory, and networking. Nomad's network plugin support extends this to allow scheduling tasks with purpose-created or specialty network configurations. Network plugins are third-party plugins that conform to the Container Network Interface (CNI) specification.
Network plugins need to be installed and configured on each client. The Nomad
installation instructions recommend installing the CNI
reference plugins because certain Nomad networking features, like
bridge network mode and Consul service mesh, leverage them to provide an
operating-system agnostic interface to configure workload networking.
Custom networking in Nomad is accomplished with a combination of CNI plugin binaries and CNI configuration files.
Spec-compliant plugins should work with Nomad, however, it's possible a plugin vendor has implemented their plugin to make non-standard API calls, or it is otherwise non-compliant with the CNI specification. In those situations the plugin may not function correctly in a Nomad environment. You should verify plugin compatibility with Nomad before deploying in production.
CNI plugins are installed and configured on a per-client basis. Nomad consults
the path given in the client's
cni_path to find CNI plugin executables.
CNI defines a network configuration format for administrators. It contains directives for both the orchestrator and the plugins to consume. At plugin execution time, this configuration format is interpreted by the runtime and transformed in to a form to be passed to the plugins.
Nomad reads the following extensions from the
/opt/cni/config by default:
You can read more about how Nomad uses CNI plugins in the CNI section of the Nomad Networking documentation.