forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
openshift_controller.go
38 lines (30 loc) · 1.19 KB
/
openshift_controller.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package kubeapiserver
import (
"path"
"github.com/golang/glog"
"github.com/openshift/origin/pkg/oc/clusterup/componentinstall"
"github.com/openshift/origin/pkg/oc/clusterup/coreinstall/tmpformac"
)
func MakeOpenShiftControllerConfig(existingMasterConfig string, basedir string) (string, error) {
configDir := path.Join(basedir, OpenShiftControllerManagerDirName)
glog.V(1).Infof("Copying kube-apiserver config to local directory %s", OpenShiftControllerManagerDirName)
if err := tmpformac.CopyDirectory(existingMasterConfig, configDir); err != nil {
return "", err
}
// update some listen information to include starting the DNS server
masterconfigFilename := path.Join(configDir, "master-config.yaml")
masterconfig, err := componentinstall.ReadMasterConfig(masterconfigFilename)
if err != nil {
return "", err
}
masterconfig.ServingInfo.BindAddress = "0.0.0.0:8444"
// disable the service serving cert signer because that runs in a separate pod now
masterconfig.ControllerConfig.Controllers = []string{
"*",
"-openshift.io/service-serving-cert",
}
if err := componentinstall.WriteMasterConfig(masterconfigFilename, masterconfig); err != nil {
return "", err
}
return configDir, nil
}