diff --git a/pkg/cmd/server/kubernetes/master/master_config.go b/pkg/cmd/server/kubernetes/master/master_config.go index eeb3bf7f2f67..951e5a20780f 100644 --- a/pkg/cmd/server/kubernetes/master/master_config.go +++ b/pkg/cmd/server/kubernetes/master/master_config.go @@ -79,7 +79,6 @@ import ( "github.com/openshift/origin/pkg/cmd/flagtypes" configapi "github.com/openshift/origin/pkg/cmd/server/apis/config" "github.com/openshift/origin/pkg/cmd/server/election" - nodeclient "github.com/openshift/origin/pkg/cmd/server/kubernetes/node/client" cmdutil "github.com/openshift/origin/pkg/cmd/util" cmdflags "github.com/openshift/origin/pkg/cmd/util/flags" oauthutil "github.com/openshift/origin/pkg/oauth/util" @@ -175,6 +174,12 @@ func BuildKubeAPIserverOptions(masterConfig configapi.MasterConfig) (*kapiserver } server.KubeletConfig.ReadOnlyPort = 0 + server.KubeletConfig.Port = masterConfig.KubeletClientInfo.Port + server.KubeletConfig.PreferredAddressTypes = []string{"Hostname", "InternalIP", "ExternalIP"} + server.KubeletConfig.EnableHttps = true + server.KubeletConfig.CAFile = masterConfig.KubeletClientInfo.CA + server.KubeletConfig.CertFile = masterConfig.KubeletClientInfo.ClientCert.CertFile + server.KubeletConfig.KeyFile = masterConfig.KubeletClientInfo.ClientCert.KeyFile server.ProxyClientCertFile = masterConfig.AggregatorConfig.ProxyClientInfo.CertFile server.ProxyClientKeyFile = masterConfig.AggregatorConfig.ProxyClientInfo.KeyFile @@ -507,7 +512,7 @@ func buildKubeApiserverConfig( EventTTL: apiserverOptions.EventTTL, - KubeletClientConfig: *nodeclient.GetKubeletClientConfig(masterConfig), + KubeletClientConfig: apiserverOptions.KubeletConfig, EnableLogsSupport: false, // don't expose server logs }, diff --git a/pkg/cmd/server/kubernetes/node/client/client.go b/pkg/cmd/server/kubernetes/node/client/client.go deleted file mode 100644 index 8e72d67a1d57..000000000000 --- a/pkg/cmd/server/kubernetes/node/client/client.go +++ /dev/null @@ -1,31 +0,0 @@ -package client - -import ( - kubeletclient "k8s.io/kubernetes/pkg/kubelet/client" - - configapi "github.com/openshift/origin/pkg/cmd/server/apis/config" -) - -func GetKubeletClientConfig(options configapi.MasterConfig) *kubeletclient.KubeletClientConfig { - config := &kubeletclient.KubeletClientConfig{ - Port: options.KubeletClientInfo.Port, - PreferredAddressTypes: []string{ - string("Hostname"), - string("InternalIP"), - string("ExternalIP"), - }, - } - - if len(options.KubeletClientInfo.CA) > 0 { - config.EnableHttps = true - config.CAFile = options.KubeletClientInfo.CA - } - - if len(options.KubeletClientInfo.ClientCert.CertFile) > 0 { - config.EnableHttps = true - config.CertFile = options.KubeletClientInfo.ClientCert.CertFile - config.KeyFile = options.KubeletClientInfo.ClientCert.KeyFile - } - - return config -}