@@ -69,6 +69,7 @@ type NetworkRoutingController struct {
6969	bgpRRServer           bool 
7070	bgpClusterId          uint32 
7171	cniConfFile           string 
72+ 	initSrcDstCheckDone   bool 
7273}
7374
7475var  (
@@ -117,6 +118,7 @@ func (nrc *NetworkRoutingController) Run(healthChan chan<- *ControllerHeartbeat,
117118
118119	// In case of cluster provisioned on AWS disable source-destination check 
119120	nrc .disableSourceDestinationCheck ()
121+ 	nrc .initSrcDstCheckDone  =  true 
120122
121123	// enable IP forwarding for the packets coming in/out from the pods 
122124	err  =  nrc .enableForwarding ()
@@ -1338,7 +1340,12 @@ func (nrc *NetworkRoutingController) OnNodeUpdate(nodeUpdate *watchers.NodeUpdat
13381340	if  nrc .bgpEnableInternal  {
13391341		nrc .syncInternalPeers ()
13401342	}
1341- 	nrc .disableSourceDestinationCheck ()
1343+ 
1344+ 	// skip if first round of disableSourceDestinationCheck() is not done yet, this is to prevent 
1345+ 	// all the nodes for all the node add update trying to perfrom disableSourceDestinationCheck 
1346+ 	if  nrc .initSrcDstCheckDone  {
1347+ 		nrc .disableSourceDestinationCheck ()
1348+ 	}
13421349}
13431350
13441351func  (nrc  * NetworkRoutingController ) startBgpServer () error  {
@@ -1563,6 +1570,7 @@ func NewNetworkRoutingController(clientset *kubernetes.Clientset,
15631570	nrc .bgpRRClient  =  false 
15641571	nrc .bgpRRServer  =  false 
15651572	nrc .bgpServerStarted  =  false 
1573+ 	nrc .initSrcDstCheckDone  =  false 
15661574
15671575	nrc .cniConfFile  =  os .Getenv ("KUBE_ROUTER_CNI_CONF_FILE" )
15681576	if  nrc .cniConfFile  ==  ""  {
0 commit comments