1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 22:46:25 +00:00

addons based on k8s jobs and configmaps

This commit is contained in:
moelsayed
2017-11-18 14:51:28 +02:00
parent 0fe952fd10
commit 9e2c352bc7
9 changed files with 511 additions and 109 deletions

View File

@@ -1,25 +1,21 @@
package cluster
import (
"fmt"
"github.com/rancher/rke/network"
"github.com/sirupsen/logrus"
)
const (
ClusterCIDREnvName = "RKE_CLUSTER_CIDR"
NetworkPluginResourceName = "rke-netwok-plugin"
)
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)
pluginYaml := network.GetFlannelManifest(c.ClusterCIDR)
if err := c.doAddonDeploy(pluginYaml, NetworkPluginResourceName); err != nil {
return err
}
logrus.Infof("[network] Network plugin deployed successfully..")
return nil