Merge pull request #117872 from danwinship/kep-3453-to-ga
MinimizeIPTablesRestore to GA
This commit is contained in:
		@@ -986,7 +986,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	MinDomainsInPodTopologySpread: {Default: true, PreRelease: featuregate.Beta},
 | 
						MinDomainsInPodTopologySpread: {Default: true, PreRelease: featuregate.Beta},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	MinimizeIPTablesRestore: {Default: true, PreRelease: featuregate.Beta},
 | 
						MinimizeIPTablesRestore: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.30
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	MultiCIDRRangeAllocator: {Default: false, PreRelease: featuregate.Alpha},
 | 
						MultiCIDRRangeAllocator: {Default: false, PreRelease: featuregate.Alpha},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,11 +38,9 @@ import (
 | 
				
			|||||||
	"k8s.io/apimachinery/pkg/types"
 | 
						"k8s.io/apimachinery/pkg/types"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/util/sets"
 | 
						"k8s.io/apimachinery/pkg/util/sets"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/util/wait"
 | 
						"k8s.io/apimachinery/pkg/util/wait"
 | 
				
			||||||
	utilfeature "k8s.io/apiserver/pkg/util/feature"
 | 
					 | 
				
			||||||
	"k8s.io/client-go/tools/events"
 | 
						"k8s.io/client-go/tools/events"
 | 
				
			||||||
	utilsysctl "k8s.io/component-helpers/node/util/sysctl"
 | 
						utilsysctl "k8s.io/component-helpers/node/util/sysctl"
 | 
				
			||||||
	"k8s.io/klog/v2"
 | 
						"k8s.io/klog/v2"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/features"
 | 
					 | 
				
			||||||
	"k8s.io/kubernetes/pkg/proxy"
 | 
						"k8s.io/kubernetes/pkg/proxy"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/proxy/conntrack"
 | 
						"k8s.io/kubernetes/pkg/proxy/conntrack"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/proxy/healthcheck"
 | 
						"k8s.io/kubernetes/pkg/proxy/healthcheck"
 | 
				
			||||||
@@ -779,7 +777,9 @@ func (proxier *Proxier) syncProxyRules() {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	tryPartialSync := !proxier.needFullSync && utilfeature.DefaultFeatureGate.Enabled(features.MinimizeIPTablesRestore)
 | 
						// The value of proxier.needFullSync may change before the defer funcs run, so
 | 
				
			||||||
 | 
						// we need to keep track of whether it was set at the *start* of the sync.
 | 
				
			||||||
 | 
						tryPartialSync := !proxier.needFullSync
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Keep track of how long syncs take.
 | 
						// Keep track of how long syncs take.
 | 
				
			||||||
	start := time.Now()
 | 
						start := time.Now()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,11 +38,8 @@ import (
 | 
				
			|||||||
	"k8s.io/apimachinery/pkg/types"
 | 
						"k8s.io/apimachinery/pkg/types"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/util/intstr"
 | 
						"k8s.io/apimachinery/pkg/util/intstr"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/util/sets"
 | 
						"k8s.io/apimachinery/pkg/util/sets"
 | 
				
			||||||
	utilfeature "k8s.io/apiserver/pkg/util/feature"
 | 
					 | 
				
			||||||
	featuregatetesting "k8s.io/component-base/featuregate/testing"
 | 
					 | 
				
			||||||
	"k8s.io/component-base/metrics/testutil"
 | 
						"k8s.io/component-base/metrics/testutil"
 | 
				
			||||||
	"k8s.io/klog/v2"
 | 
						"k8s.io/klog/v2"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/features"
 | 
					 | 
				
			||||||
	"k8s.io/kubernetes/pkg/proxy"
 | 
						"k8s.io/kubernetes/pkg/proxy"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/proxy/conntrack"
 | 
						"k8s.io/kubernetes/pkg/proxy/conntrack"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/proxy/metrics"
 | 
						"k8s.io/kubernetes/pkg/proxy/metrics"
 | 
				
			||||||
@@ -7420,8 +7417,6 @@ func countEndpointsAndComments(iptablesData string, matchEndpoint string) (strin
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestSyncProxyRulesLargeClusterMode(t *testing.T) {
 | 
					func TestSyncProxyRulesLargeClusterMode(t *testing.T) {
 | 
				
			||||||
	defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.MinimizeIPTablesRestore, true)()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	ipt := iptablestest.NewFake()
 | 
						ipt := iptablestest.NewFake()
 | 
				
			||||||
	fp := NewFakeProxier(ipt)
 | 
						fp := NewFakeProxier(ipt)
 | 
				
			||||||
	fp.masqueradeAll = true
 | 
						fp.masqueradeAll = true
 | 
				
			||||||
@@ -7609,8 +7604,6 @@ func TestSyncProxyRulesLargeClusterMode(t *testing.T) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Test calling syncProxyRules() multiple times with various changes
 | 
					// Test calling syncProxyRules() multiple times with various changes
 | 
				
			||||||
func TestSyncProxyRulesRepeated(t *testing.T) {
 | 
					func TestSyncProxyRulesRepeated(t *testing.T) {
 | 
				
			||||||
	defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.MinimizeIPTablesRestore, true)()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	ipt := iptablestest.NewFake()
 | 
						ipt := iptablestest.NewFake()
 | 
				
			||||||
	fp := NewFakeProxier(ipt)
 | 
						fp := NewFakeProxier(ipt)
 | 
				
			||||||
	metrics.RegisterMetrics()
 | 
						metrics.RegisterMetrics()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,9 +27,8 @@ import (
 | 
				
			|||||||
const kubeProxySubsystem = "kubeproxy"
 | 
					const kubeProxySubsystem = "kubeproxy"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var (
 | 
				
			||||||
	// SyncProxyRulesLatency is the latency of one round of kube-proxy syncing proxy rules.
 | 
						// SyncProxyRulesLatency is the latency of one round of kube-proxy syncing proxy
 | 
				
			||||||
	// (With the iptables proxy, if MinimizeIPTablesRestore is enabled, this includes both
 | 
						// rules. (With the iptables proxy, this includes both full and partial syncs.)
 | 
				
			||||||
	// full and partial syncs.)
 | 
					 | 
				
			||||||
	SyncProxyRulesLatency = metrics.NewHistogram(
 | 
						SyncProxyRulesLatency = metrics.NewHistogram(
 | 
				
			||||||
		&metrics.HistogramOpts{
 | 
							&metrics.HistogramOpts{
 | 
				
			||||||
			Subsystem:      kubeProxySubsystem,
 | 
								Subsystem:      kubeProxySubsystem,
 | 
				
			||||||
@@ -40,8 +39,7 @@ var (
 | 
				
			|||||||
		},
 | 
							},
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// SyncFullProxyRulesLatency is the latency of one round of full rule syncing, when
 | 
						// SyncFullProxyRulesLatency is the latency of one round of full rule syncing.
 | 
				
			||||||
	// MinimizeIPTablesRestore is enabled.
 | 
					 | 
				
			||||||
	SyncFullProxyRulesLatency = metrics.NewHistogram(
 | 
						SyncFullProxyRulesLatency = metrics.NewHistogram(
 | 
				
			||||||
		&metrics.HistogramOpts{
 | 
							&metrics.HistogramOpts{
 | 
				
			||||||
			Subsystem:      kubeProxySubsystem,
 | 
								Subsystem:      kubeProxySubsystem,
 | 
				
			||||||
@@ -52,8 +50,7 @@ var (
 | 
				
			|||||||
		},
 | 
							},
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// SyncPartialProxyRulesLatency is the latency of one round of partial rule syncing, when
 | 
						// SyncPartialProxyRulesLatency is the latency of one round of partial rule syncing.
 | 
				
			||||||
	// MinimizeIPTablesRestore is enabled.
 | 
					 | 
				
			||||||
	SyncPartialProxyRulesLatency = metrics.NewHistogram(
 | 
						SyncPartialProxyRulesLatency = metrics.NewHistogram(
 | 
				
			||||||
		&metrics.HistogramOpts{
 | 
							&metrics.HistogramOpts{
 | 
				
			||||||
			Subsystem:      kubeProxySubsystem,
 | 
								Subsystem:      kubeProxySubsystem,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user