mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 02:08:13 +00:00 
			
		
		
		
	 3948f16ff4
			
		
	
	3948f16ff4
	
	
	
		
			
			Kubelet and kube-proxy both had loops to ensure that their iptables rules didn't get deleted, by repeatedly recreating them. But on systems with lots of iptables rules (ie, thousands of services), this can be very slow (and thus might end up holding the iptables lock for several seconds, blocking other operations, etc). The specific threat that they need to worry about is firewall-management commands that flush *all* dynamic iptables rules. So add a new iptables.Monitor() function that handles this by creating iptables-flush canaries and only triggering a full rule reload after noticing that someone has deleted those chains.
		
			
				
	
	
		
			23 lines
		
	
	
		
			661 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			661 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // +build !linux
 | |
| 
 | |
| /*
 | |
| Copyright 2018 The Kubernetes Authors.
 | |
| 
 | |
| Licensed under the Apache License, Version 2.0 (the "License");
 | |
| you may not use this file except in compliance with the License.
 | |
| You may obtain a copy of the License at
 | |
| 
 | |
|     http://www.apache.org/licenses/LICENSE-2.0
 | |
| 
 | |
| Unless required by applicable law or agreed to in writing, software
 | |
| distributed under the License is distributed on an "AS IS" BASIS,
 | |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | |
| See the License for the specific language governing permissions and
 | |
| limitations under the License.
 | |
| */
 | |
| 
 | |
| package kubelet
 | |
| 
 | |
| // Do nothing.
 | |
| func (kl *Kubelet) initNetworkUtil() {}
 |