Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to k8s-v1.7 #1693

Merged
merged 13 commits into from
Jul 14, 2017
Prev Previous commit
Next Next commit
Structural changes to kube-proxy and apiserver
  • Loading branch information
r2d4 committed Jul 13, 2017
commit 81fa73d2df7dd7805fbe7eb42fa1a239fec8c344
9 changes: 7 additions & 2 deletions pkg/localkube/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ func StartAPIServer(lk LocalkubeServer) func() error {

config.SecureServing.ServerCert.CertKey.CertFile = lk.GetPublicKeyCertPath()
config.SecureServing.ServerCert.CertKey.KeyFile = lk.GetPrivateKeyCertPath()
config.GenericServerRunOptions.AdmissionControl = "NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota"

config.Admission.PluginNames = []string{
"NamespaceLifecycle",
"LimitRanger",
"ServiceAccount",
"DefaultStorageClass",
"ResourceQuota",
}
// use localkube etcd

config.Etcd.StorageConfig.ServerList = KubeEtcdClientURLs
Expand Down
25 changes: 13 additions & 12 deletions pkg/localkube/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package localkube
import (
kubeproxy "k8s.io/kubernetes/cmd/kube-proxy/app"

"k8s.io/kubernetes/cmd/kube-proxy/app/options"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/apis/componentconfig"
"k8s.io/kubernetes/pkg/kubelet/qos"
)
Expand All @@ -34,22 +34,23 @@ func (lk LocalkubeServer) NewProxyServer() Server {
}

func StartProxyServer(lk LocalkubeServer) func() error {
config := options.NewProxyConfig()

// master details
config.Master = lk.GetAPIServerInsecureURL()

config.Mode = componentconfig.ProxyModeIPTables

// defaults
config.OOMScoreAdj = &OOMScoreAdj
config.IPTablesMasqueradeBit = &MasqueradeBit
config := &componentconfig.KubeProxyConfiguration{
OOMScoreAdj: &OOMScoreAdj,
IPTables: componentconfig.KubeProxyIPTablesConfiguration{
MasqueradeBit: &MasqueradeBit,
},
BindAddress: lk.APIServerInsecureAddress.String(),
Mode: componentconfig.ProxyModeIPTables,
FeatureGates: lk.FeatureGates,
// Disable the healthz check
HealthzBindAddress: "0",
}

lk.SetExtraConfigForComponent("proxy", &config)

return func() error {
// Creating this config requires the API Server to be up, so do it in the start function itself.
server, err := kubeproxy.NewProxyServerDefault(config)
server, err := kubeproxy.NewProxyServer(config, false, runtime.NewScheme(), lk.GetAPIServerInsecureURL())
if err != nil {
panic(err)
}
Expand Down