1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-29 03:40:55 +00:00
rke/services/controlplane.go
2017-11-09 21:50:49 +02:00

31 lines
806 B
Go

package services
import (
"github.com/Sirupsen/logrus"
"github.com/alena1108/cluster-controller/client/v1"
"github.com/rancher/rke/hosts"
)
func RunControlPlane(controlHosts []hosts.Host, etcdHosts []hosts.Host, controlServices v1.RKEConfigServices) error {
logrus.Infof("[%s] Building up Controller Plane..", ControlRole)
for _, host := range controlHosts {
// run kubeapi
err := runKubeAPI(host, etcdHosts, controlServices.KubeAPI)
if err != nil {
return err
}
// run kubecontroller
err = runKubeController(host, controlServices.KubeController)
if err != nil {
return err
}
// run scheduler
err = runScheduler(host, controlServices.Scheduler)
if err != nil {
return err
}
}
logrus.Infof("[%s] Successfully started Controller Plane..", ControlRole)
return nil
}