You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task drivers are not currently supplied much information about the network specification produced by CNI plugins. For example, consider the following CNI configuration:
The network manager reads the mode cni/test (ref network_manager_linux.go#L192-L197 and calls newCNINetworkConfigurator in networking_cni.go, which ultimately calls Setup. The debug log line we get here has plenty of detail about the resulting spec:
2023-03-23T14:37:04.978-0400 [DEBUG] client.alloc_runner.runner_hook: received result from CNI: alloc_id=078c18df-01cc-d337-6d82-4b0b5d9984d0 result="{"Interfaces":{"eth0":{"IPConfigs":[{"IP":"192.168.40.36","Gateway":"192.168.40.1"}],"Mac":"da:cc:07:05:a4:9d","Sandbox":"/var/run/netns/078c18df-01cc-d337-6d82-4b0b5d9984d0"},"vethd60fa44f":{"IPConfigs":null,"Mac":"fe:26:66:49:d8:2d","Sandbox":""},"virbr0":{"IPConfigs":null,"Mac":"52:54:00:60:7f:fc","Sandbox":""}},"DNS":[{}],"Routes":[{"dst":"0.0.0.0/0","gw":"192.168.40.1"}]}"
But if we add a spew.Dump to the top of the task driver's StartTask, we get the following NetworkIsolation block:
While this works fine for our built-in task drivers, @eveld has reported a need for custom task drivers to know about how the network was configured, so that they can set appropriate values in the task (for example, setting the IP in a Firecracker VM's MMDS).
We currently pass some of this information along for bridge networking if the driver has set some Docker-specific tags (ref network_hook.go#L132-L175, but this doesn't work for CNI and in any case shouldn't be Docker-specific.
The text was updated successfully, but these errors were encountered:
The firecracker-go-sdk can either set up CNI itself or can use a static interface which allows us to pass on the details of the interfaces that Nomad created.
The cni.Result has all the details I would need to configure that. Having that exposed to the driver would solve my dilemma. Perhaps other drivers have a similar need.
I've been fighting with these for a few days and I'm on the verge of giving up. I believe what @eveld is proposing would be beneficial. Happy to open a PR if this is possible 😄
While working on #10628 I bumped into this in terms of missing DNS configuration, as described in #11102. Threading the cni.Result down into the task driver might be the best solution to this or we could add the missing fields to the existing fields on drivers.TaskConfig
Task drivers are not currently supplied much information about the network specification produced by CNI plugins. For example, consider the following CNI configuration:
I've used this with a simple
raw_exec
task for purposes of illustration:jobspec
The network manager reads the mode
cni/test
(refnetwork_manager_linux.go#L192-L197
and callsnewCNINetworkConfigurator
innetworking_cni.go
, which ultimately callsSetup
. The debug log line we get here has plenty of detail about the resulting spec:But if we add a
spew.Dump
to the top of the task driver'sStartTask
, we get the followingNetworkIsolation
block:While this works fine for our built-in task drivers, @eveld has reported a need for custom task drivers to know about how the network was configured, so that they can set appropriate values in the task (for example, setting the IP in a Firecracker VM's MMDS).
We currently pass some of this information along for
bridge
networking if the driver has set some Docker-specific tags (refnetwork_hook.go#L132-L175
, but this doesn't work for CNI and in any case shouldn't be Docker-specific.The text was updated successfully, but these errors were encountered: