Ejemplo n.º 1
0
// RunSDNController runs openshift-sdn if the said network plugin is provided
func (c *MasterConfig) RunSDNController() {
	osclient, kclient := c.SDNControllerClients()
	switch c.Options.NetworkConfig.NetworkPluginName {
	case flatsdn.NetworkPluginName():
		flatsdn.Master(osclient, kclient, c.Options.NetworkConfig.ClusterNetworkCIDR, c.Options.NetworkConfig.HostSubnetLength)
	case multitenant.NetworkPluginName():
		multitenant.Master(osclient, kclient, c.Options.NetworkConfig.ClusterNetworkCIDR, c.Options.NetworkConfig.HostSubnetLength)
	}
}
Ejemplo n.º 2
0
func RunSDNController(config *kubernetes.NodeConfig, nodeConfig configapi.NodeConfig) {
	oclient, _, err := configapi.GetOpenShiftClient(nodeConfig.MasterKubeConfig)
	if err != nil {
		glog.Fatal("Failed to get kube client for SDN")
	}

	switch nodeConfig.NetworkPluginName {
	case flatsdn.NetworkPluginName():
		ch := make(chan struct{})
		config.KubeletConfig.StartUpdates = ch
		go flatsdn.Node(oclient, config.Client, nodeConfig.NodeName, "", ch)
	case multitenant.NetworkPluginName():
		ch := make(chan struct{})
		config.KubeletConfig.StartUpdates = ch
		plugin := multitenant.GetKubeNetworkPlugin()
		config.KubeletConfig.NetworkPlugins = append(config.KubeletConfig.NetworkPlugins, plugin)
		go multitenant.Node(oclient, config.Client, nodeConfig.NodeName, "", ch, plugin)
	}
}