1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-30 21:50:21 +00:00

Adding ability to set cluster network to none

This commit is contained in:
Chris Kim 2018-11-27 19:23:15 -05:00 committed by Alena Prokharchyk
parent ff4c93e179
commit afaad6c824
2 changed files with 6 additions and 1 deletions

View File

@ -39,6 +39,8 @@ const (
ProtocolTCP = "TCP"
ProtocolUDP = "UDP"
NoNetworkPlugin = "none"
FlannelNetworkPlugin = "flannel"
FlannelIface = "flannel_iface"
FlannelBackendType = "flannel_backend_type"
@ -122,6 +124,9 @@ func (c *Cluster) deployNetworkPlugin(ctx context.Context) error {
return c.doCanalDeploy(ctx)
case WeaveNetworkPlugin:
return c.doWeaveDeploy(ctx)
case NoNetworkPlugin:
log.Infof(ctx, "[network] Not deploying a cluster network, expecting custom CNI")
return nil
default:
return fmt.Errorf("[network] Unsupported network plugin: %s", c.Network.Plugin)
}

View File

@ -46,7 +46,7 @@ func validateAuthOptions(c *Cluster) error {
}
func validateNetworkOptions(c *Cluster) error {
if c.Network.Plugin != FlannelNetworkPlugin && c.Network.Plugin != CalicoNetworkPlugin && c.Network.Plugin != CanalNetworkPlugin && c.Network.Plugin != WeaveNetworkPlugin {
if c.Network.Plugin != NoNetworkPlugin && c.Network.Plugin != FlannelNetworkPlugin && c.Network.Plugin != CalicoNetworkPlugin && c.Network.Plugin != CanalNetworkPlugin && c.Network.Plugin != WeaveNetworkPlugin {
return fmt.Errorf("Network plugin [%s] is not supported", c.Network.Plugin)
}
return nil