2017-10-29 09:45:21 +00:00
|
|
|
package services
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
|
|
"github.com/rancher/rke/hosts"
|
|
|
|
)
|
|
|
|
|
2017-10-31 13:55:35 +00:00
|
|
|
func RunControlPlane(controlHosts []hosts.Host, etcdHosts []hosts.Host, controlServices Services) error {
|
|
|
|
logrus.Infof("[%s] Building up Controller Plane..", ControlRole)
|
|
|
|
for _, host := range controlHosts {
|
2017-10-29 09:45:21 +00:00
|
|
|
// run kubeapi
|
2017-10-31 13:55:35 +00:00
|
|
|
err := runKubeAPI(host, etcdHosts, controlServices.KubeAPI)
|
2017-10-29 09:45:21 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
// run kubecontroller
|
2017-10-31 13:55:35 +00:00
|
|
|
err = runKubeController(host, controlServices.KubeController)
|
2017-10-29 09:45:21 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
// run scheduler
|
2017-10-31 13:55:35 +00:00
|
|
|
err = runScheduler(host, controlServices.Scheduler)
|
2017-10-29 09:45:21 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2017-10-31 13:55:35 +00:00
|
|
|
logrus.Infof("[%s] Successfully started Controller Plane..", ControlRole)
|
2017-10-29 09:45:21 +00:00
|
|
|
return nil
|
|
|
|
}
|