1
0
mirror of https://github.com/rancher/rke.git synced 2025-06-24 22:42:23 +00:00
rke/cluster/network.go

27 lines
600 B
Go
Raw Normal View History

package cluster
import (
"fmt"
"github.com/Sirupsen/logrus"
)
const (
ClusterCIDREnvName = "RKE_CLUSTER_CIDR"
)
func (c *Cluster) DeployNetworkPlugin() error {
logrus.Infof("[network] Setting up network plugin: %s", c.NetworkPlugin)
kubectlCmd := &KubectlCommand{
Cmd: []string{"apply -f /network/" + c.NetworkPlugin + ".yaml"},
}
logrus.Infof("[network] Executing the deploy command..")
err := c.RunKubectlCmd(kubectlCmd)
if err != nil {
return fmt.Errorf("Failed to run kubectl command: %v", err)
}
logrus.Infof("[network] Network plugin deployed successfully..")
return nil
}