From afb7c63d92fb18d67d355908ae6261a40f1e0713 Mon Sep 17 00:00:00 2001 From: Matt Rickard Date: Fri, 14 Jul 2017 10:58:21 -0700 Subject: [PATCH] Restore some kube-proxy defaults Set some kube-proxy defaults that got unset through the new way of configuring kube-proxy. Add more delay to the ip tables syncing reduces idle CPU load a lot. See https://github.com/kubernetes/minikube/issues/1158#issuecomment-315308205 --- pkg/localkube/proxy.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/localkube/proxy.go b/pkg/localkube/proxy.go index 02fce23d3017..1d37c364faf9 100644 --- a/pkg/localkube/proxy.go +++ b/pkg/localkube/proxy.go @@ -19,6 +19,9 @@ package localkube import ( kubeproxy "k8s.io/kubernetes/cmd/kube-proxy/app" + "time" + + "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/kubernetes/pkg/apis/componentconfig" "k8s.io/kubernetes/pkg/kubelet/qos" @@ -36,8 +39,15 @@ func (lk LocalkubeServer) NewProxyServer() Server { func StartProxyServer(lk LocalkubeServer) func() error { config := &componentconfig.KubeProxyConfiguration{ OOMScoreAdj: &OOMScoreAdj, + ClientConnection: componentconfig.ClientConnectionConfiguration{ + Burst: 10, + QPS: 5, + }, + ConfigSyncPeriod: v1.Duration{Duration: 15 * time.Minute}, IPTables: componentconfig.KubeProxyIPTablesConfiguration{ MasqueradeBit: &MasqueradeBit, + SyncPeriod: v1.Duration{Duration: 30 * time.Second}, + MinSyncPeriod: v1.Duration{Duration: 5 * time.Second}, }, BindAddress: lk.APIServerInsecureAddress.String(), Mode: componentconfig.ProxyModeIPTables,