Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Re-work network connectivity #832

Closed
networkop opened this issue May 7, 2021 · 1 comment
Closed

Re-work network connectivity #832

networkop opened this issue May 7, 2021 · 1 comment

Comments

@networkop
Copy link
Contributor

Hi again 👋 ,
I've been looking at how network plumbing has been done and I think it can be improved slightly.
Right now networking is setup after the container is started.

providers.Runtime.RunContainer
...
providers.NetworkPlugin.SetupContainerNetwork

Followed by the ignite-spawn 's call to SetupContainerNetworking which waits for at least one interface to be connected.

The problem is that, in theory, this could lead to non-deterministic networking setup. Let's assume that we have some CNI plugin connecting more than one interface at the same time as wait.PollImmediate in pkg/container/network.go tries to setup its networks. Because these two processes happen in parallel, it's possible to either see all interfaces or only a subset of them, if CNI hasn't connected them all yet.

So an alternative solution could be something like this:

  1. Create a container during ignite create -- this would require an extra function in container Interface
  2. Connect all the interfaces with CNI/CNM right after this step
  3. Change the behaviour of ignite start to just call RunContainer -- obv, dropping the option for user to reconfigure VMs on the start.

There may be some reason for why it was done this way that I'm not aware of but if you think what I've descibed makes sense, I'm happy to do a PR 😄

@darkowlzz
Copy link
Contributor

Addressed in #836

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants