1
0
mirror of https://github.com/rancher/rke.git synced 2025-06-25 23:12:30 +00:00
rke/cluster/network.go
2017-11-14 20:11:21 +02:00

27 lines
602 B
Go

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.Network.Plugin)
kubectlCmd := &KubectlCommand{
Cmd: []string{"apply -f /network/" + c.Network.Plugin + ".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
}