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

Let network-manager be able to support other CNI drivers(Calico/Flat/Macvlan) #8535

Closed
niusmallnan opened this Issue Apr 18, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@niusmallnan
Member

niusmallnan commented Apr 18, 2017

The CNI config file not being populated if we use Calico or Flat CNI drivers. Here are pointers:

  • When there are multiple environments with different VXLAN settings, they become two networks in Rancher. When we are setting up the CNI config, we need to setup the config for the network which belongs to the environment.
  • This information is not present currently in the metadata.
  • To workaround that the fix was to match the vxlan container’s hostUUID with the self.hostUUID and get the network ID from that.
  • This works for vxlan because it’s running in it’s own network namespace.
  • Calico runs with --net=host and this breaks the assumption made earlier.

To fix this bug, it would be nice if we can add a field(environment_uuid) here.
image

Then we can use network.EnvironmentUUID to get local CNI network in network-manager(cniconf/watcher.go).

	for _, network := range networks {
		if !network.Default || network.EnvironmentUUID != host.EnvironmentUUID {
			logrus.Debugf("network: %v is not local to this environment", network.UUID)
			continue
		}
		_, ok := network.Metadata["cniConfig"].(map[string]interface{})
		if !ok {
			continue
		}

		if forceApply || !reflect.DeepEqual(w.applied[network.Name], network) {
			if err := w.apply(network); err != nil {
				logrus.Errorf("Failed to apply cni conf: %v", err)
			}
		}
	}

Related changes:

  1. add network.environment_uuid in metadata(cattle)
  2. update go-rancher-metadata
  3. update plugin-manager(depends on the second)
@niusmallnan

This comment has been minimized.

Show comment
Hide comment
@niusmallnan

niusmallnan Apr 26, 2017

Member

Progress display:

  1. add network.environment_uuid in metadata(cattle). merged
  2. update go-rancher-metadata. merged
  3. update plugin-manager(depends on the second)

@leodotcloud I have created a PR to plugin-manager. Can you help me check the code when you are free ? We discussed the problem in the mail before.

Member

niusmallnan commented Apr 26, 2017

Progress display:

  1. add network.environment_uuid in metadata(cattle). merged
  2. update go-rancher-metadata. merged
  3. update plugin-manager(depends on the second)

@leodotcloud I have created a PR to plugin-manager. Can you help me check the code when you are free ? We discussed the problem in the mail before.

@niusmallnan

This comment has been minimized.

Show comment
Hide comment
@niusmallnan

niusmallnan May 3, 2017

Member

Misson complete.

Member

niusmallnan commented May 3, 2017

Misson complete.

@ribukshin

This comment has been minimized.

Show comment
Hide comment
@ribukshin

ribukshin May 8, 2017

Can you please share an example to configure Rancher to use calico for container networking?

ribukshin commented May 8, 2017

Can you please share an example to configure Rancher to use calico for container networking?

@niusmallnan

This comment has been minimized.

Show comment
Hide comment
@niusmallnan

niusmallnan May 9, 2017

Member

@ribukshin You see this #8603 .

Member

niusmallnan commented May 9, 2017

@ribukshin You see this #8603 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment