From 965cf128b660bc576ad4db561eed6ae3485721c4 Mon Sep 17 00:00:00 2001 From: Phil Cameron Date: Fri, 27 Oct 2017 09:14:35 -0400 Subject: [PATCH] Remove iptables log on restore failure Don't log the set of rules at v2 in kube-proxy on error. The rules are displayed at v5 before the restore is attempted. In a large cluster the report can generate up to 100000 lines. A partial report is only helpful if the problem is displayed in the partial report. --- pkg/proxy/iptables/proxier.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index 56ef7cb6bb6..1561eff0a61 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -1578,20 +1578,6 @@ func (proxier *Proxier) syncProxyRules() { err = proxier.iptables.RestoreAll(proxier.iptablesData.Bytes(), utiliptables.NoFlushTables, utiliptables.RestoreCounters) if err != nil { glog.Errorf("Failed to execute iptables-restore: %v", err) - // ~rough approximation, assume ~100 chars per line - // we log first 1000 bytes, but full list at higher levels - rules := proxier.iptablesData.Bytes() - if len(rules) > 1000 { - abridgedRules := rules[:1000] - if glog.V(4) { - glog.V(4).Infof("Rules:\n%s", rules) - } else { - glog.V(2).Infof("Rules (abridged):\n%s", abridgedRules) - } - } else { - glog.V(2).Infof("Rules:\n%s", rules) - } - // Revert new local ports. glog.V(2).Infof("Closing local ports after iptables-restore failure") utilproxy.RevertPorts(replacementPortsMap, proxier.portsMap)