2017-11-06 20:50:41 +00:00
|
|
|
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)
|
2017-11-08 17:45:51 +00:00
|
|
|
|
|
|
|
kubectlCmd := &KubectlCommand{
|
|
|
|
Cmd: []string{"apply -f /network/" + c.NetworkPlugin + ".yaml"},
|
2017-11-06 20:50:41 +00:00
|
|
|
}
|
|
|
|
logrus.Infof("[network] Executing the deploy command..")
|
2017-11-08 17:45:51 +00:00
|
|
|
err := c.RunKubectlCmd(kubectlCmd)
|
2017-11-06 20:50:41 +00:00
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("Failed to run kubectl command: %v", err)
|
|
|
|
}
|
|
|
|
logrus.Infof("[network] Network plugin deployed successfully..")
|
|
|
|
return nil
|
|
|
|
}
|