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:
@@ -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
|
||||
|
Reference in New Issue
Block a user