2016-05-04 08:18:00 +00:00
|
|
|
/*
|
|
|
|
Copyright 2016 The Kubernetes Authors All rights reserved.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package localkube
|
|
|
|
|
|
|
|
import (
|
2016-05-05 05:15:59 +00:00
|
|
|
"path/filepath"
|
2016-05-04 08:18:00 +00:00
|
|
|
|
|
|
|
controllerManager "k8s.io/kubernetes/cmd/kube-controller-manager/app"
|
|
|
|
"k8s.io/kubernetes/cmd/kube-controller-manager/app/options"
|
|
|
|
)
|
|
|
|
|
2016-05-09 20:35:57 +00:00
|
|
|
func (lk LocalkubeServer) NewControllerManagerServer() Server {
|
|
|
|
return NewSimpleServer("controller-manager", serverInterval, StartControllerManagerServer(lk))
|
2016-05-04 08:18:00 +00:00
|
|
|
}
|
|
|
|
|
2016-05-09 20:35:57 +00:00
|
|
|
func StartControllerManagerServer(lk LocalkubeServer) func() error {
|
2016-05-04 08:18:00 +00:00
|
|
|
config := options.NewCMServer()
|
|
|
|
|
2016-05-09 20:35:57 +00:00
|
|
|
config.Master = lk.GetAPIServerInsecureURL()
|
|
|
|
|
2016-05-04 08:18:00 +00:00
|
|
|
// defaults from command
|
|
|
|
config.DeletingPodsQps = 0.1
|
|
|
|
config.DeletingPodsBurst = 10
|
|
|
|
config.EnableProfiling = true
|
2016-05-10 12:42:40 +00:00
|
|
|
config.ServiceAccountKeyFile = filepath.Join(lk.GetCertificateDirectory(), "kubernetes-master.key")
|
2016-05-04 08:18:00 +00:00
|
|
|
|
2016-05-09 20:35:57 +00:00
|
|
|
return func() error {
|
2016-05-04 08:18:00 +00:00
|
|
|
return controllerManager.Run(config)
|
|
|
|
}
|
|
|
|
}
|