mirror of
https://github.com/rancher/rke.git
synced 2025-08-08 10:18:10 +00:00
29 lines
657 B
Go
29 lines
657 B
Go
|
package services
|
||
|
|
||
|
import (
|
||
|
"github.com/Sirupsen/logrus"
|
||
|
"github.com/rancher/rke/hosts"
|
||
|
)
|
||
|
|
||
|
func RunControlPlane(masterHosts []hosts.Host, etcdHosts []hosts.Host, masterServices Services) error {
|
||
|
logrus.Infof("[ControlPlane] Building up Controller Plane..")
|
||
|
for _, host := range masterHosts {
|
||
|
// run kubeapi
|
||
|
err := runKubeAPI(host, etcdHosts, masterServices.KubeAPI)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
// run kubecontroller
|
||
|
err = runKubeController(host, masterServices.KubeController)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
// run scheduler
|
||
|
err = runScheduler(host, masterServices.Scheduler)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
}
|
||
|
return nil
|
||
|
}
|