@@ -89,15 +89,11 @@ func (c *PodController) needSync(eventType string, obj interface{}) (string, boo
8989 return key , needSync
9090 }
9191
92- klog .Infof ("[POD %s EVENT] for %s in %s" , eventType , podObj .Name , podObj .Namespace )
93-
9492 if ! hasValidPodIP (podObj ) {
9593 return key , needSync
9694 }
9795
9896 if isHostNetworkPod (podObj ) {
99- klog .Infof ("[POD %s EVENT] HostNetwork POD IGNORED: [%s/%s/%s/%+v%s]" ,
100- eventType , podObj .GetObjectMeta ().GetUID (), podObj .Namespace , podObj .Name , podObj .Labels , podObj .Status .PodIP )
10197 return key , needSync
10298 }
10399
@@ -132,7 +128,6 @@ func (c *PodController) addPod(obj interface{}) {
132128func (c * PodController ) updatePod (old , newp interface {}) {
133129 key , needSync := c .needSync ("UPDATE" , newp )
134130 if ! needSync {
135- klog .Infof ("[POD UPDATE EVENT] No need to sync this pod" )
136131 return
137132 }
138133
@@ -143,7 +138,6 @@ func (c *PodController) updatePod(old, newp interface{}) {
143138 if oldPod .ResourceVersion == newPod .ResourceVersion {
144139 // Periodic resync will send update events for all known pods.
145140 // Two different versions of the same pods will always have different RVs.
146- klog .Infof ("[POD UPDATE EVENT] Two pods have the same RVs" )
147141 return
148142 }
149143 }
@@ -170,9 +164,7 @@ func (c *PodController) deletePod(obj interface{}) {
170164 }
171165 }
172166
173- klog .Infof ("[POD DELETE EVENT] for %s in %s" , podObj .Name , podObj .Namespace )
174167 if isHostNetworkPod (podObj ) {
175- klog .Infof ("[POD DELETE EVENT] HostNetwork POD IGNORED: [%s/%s/%s/%+v%s]" , podObj .UID , podObj .Namespace , podObj .Name , podObj .Labels , podObj .Status .PodIP )
176168 return
177169 }
178170
@@ -192,12 +184,9 @@ func (c *PodController) Run(stopCh <-chan struct{}) {
192184 defer utilruntime .HandleCrash ()
193185 defer c .workqueue .ShutDown ()
194186
195- klog .Infof ("Starting Pod worker" )
196187 go wait .Until (c .runWorker , time .Second , stopCh )
197188
198- klog .Info ("Started Pod workers" )
199189 <- stopCh
200- klog .Info ("Shutting down Pod workers" )
201190}
202191
203192func (c * PodController ) runWorker () {
@@ -235,7 +224,6 @@ func (c *PodController) processNextWorkItem() bool {
235224 // Finally, if no error occurs we Forget this item so it does not
236225 // get queued again until another change happens.
237226 c .workqueue .Forget (obj )
238- klog .Infof ("Successfully synced '%s'" , key )
239227 return nil
240228 }(obj )
241229 if err != nil {
@@ -325,14 +313,11 @@ func (c *PodController) syncPod(key string) error {
325313}
326314
327315func (c * PodController ) syncAddedPod (podObj * corev1.Pod ) error {
328- klog .Infof ("POD CREATING: [%s%s/%s/%s%+v%s]" , string (podObj .GetUID ()), podObj .Namespace ,
329- podObj .Name , podObj .Spec .NodeName , podObj .Labels , podObj .Status .PodIP )
330316
331317 var err error
332318 podNs := util .GetNSNameWithPrefix (podObj .Namespace )
333319 podKey , _ := cache .MetaNamespaceKeyFunc (podObj )
334320 // Add the pod ip information into namespace's ipset.
335- klog .Infof ("Adding pod %s to ipset %s" , podObj .Status .PodIP , podNs )
336321 if err = c .ipsMgr .AddToSet (podNs , podObj .Status .PodIP , util .IpsetNetHashFlag , podKey ); err != nil {
337322 return fmt .Errorf ("[syncAddedPod] Error: failed to add pod to namespace ipset with err: %w" , err )
338323 }
@@ -343,21 +328,18 @@ func (c *PodController) syncAddedPod(podObj *corev1.Pod) error {
343328
344329 // Get lists of podLabelKey and podLabelKey + podLavelValue ,and then start adding them to ipsets.
345330 for labelKey , labelVal := range podObj .Labels {
346- klog .Infof ("Adding pod %s to ipset %s" , npmPodObj .PodIP , labelKey )
347331 if err = c .ipsMgr .AddToSet (labelKey , npmPodObj .PodIP , util .IpsetNetHashFlag , podKey ); err != nil {
348332 return fmt .Errorf ("[syncAddedPod] Error: failed to add pod to label ipset with err: %w" , err )
349333 }
350334
351335 podIPSetName := util .GetIpSetFromLabelKV (labelKey , labelVal )
352- klog .Infof ("Adding pod %s to ipset %s" , npmPodObj .PodIP , podIPSetName )
353336 if err = c .ipsMgr .AddToSet (podIPSetName , npmPodObj .PodIP , util .IpsetNetHashFlag , podKey ); err != nil {
354337 return fmt .Errorf ("[syncAddedPod] Error: failed to add pod to label ipset with err: %w" , err )
355338 }
356339 npmPodObj .AppendLabels (map [string ]string {labelKey : labelVal }, common .AppendToExistingLabels )
357340 }
358341
359342 // Add pod's named ports from its ipset.
360- klog .Infof ("Adding named port ipsets" )
361343 containerPorts := common .GetContainerPortList (podObj )
362344 if err = c .manageNamedPortIpsets (containerPorts , podKey , npmPodObj .PodIP , addNamedPort ); err != nil {
363345 return fmt .Errorf ("[syncAddedPod] Error: failed to add pod to named port ipset with err: %w" , err )
@@ -396,7 +378,6 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
396378
397379 podKey , _ := cache .MetaNamespaceKeyFunc (newPodObj )
398380 cachedNpmPod , exists := c .podMap [podKey ]
399- klog .Infof ("[syncAddAndUpdatePod] updating Pod with key %s" , podKey )
400381 // No cached npmPod exists. start adding the pod in a cache
401382 if ! exists {
402383 if err = c .syncAddedPod (newPodObj ); err != nil {
@@ -415,15 +396,10 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
415396 // NPM should clean up existing references of cached pod obj and its IP.
416397 // then, re-add new pod obj.
417398 if cachedNpmPod .PodIP != newPodObj .Status .PodIP {
418- klog .Infof ("Pod (Namespace:%s, Name:%s, newUid:%s), has cachedPodIp:%s which is different from PodIp:%s" ,
419- newPodObj .Namespace , newPodObj .Name , string (newPodObj .UID ), cachedNpmPod .PodIP , newPodObj .Status .PodIP )
420-
421- klog .Infof ("Deleting cached Pod with key:%s first due to IP Mistmatch" , podKey )
422399 if err = c .cleanUpDeletedPod (podKey ); err != nil {
423400 return metrics .UpdateOp , err
424401 }
425402
426- klog .Infof ("Adding back Pod with key:%s after IP Mistmatch" , podKey )
427403 if err = c .syncAddedPod (newPodObj ); err != nil {
428404 return metrics .UpdateOp , err
429405 }
@@ -438,7 +414,6 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
438414
439415 // Delete the pod from its label's ipset.
440416 for _ , podIPSetName := range deleteFromIPSets {
441- klog .Infof ("Deleting pod %s from ipset %s" , cachedNpmPod .PodIP , podIPSetName )
442417 if err = c .ipsMgr .DeleteFromSet (podIPSetName , cachedNpmPod .PodIP , podKey ); err != nil {
443418 return metrics .UpdateOp , fmt .Errorf ("[syncAddAndUpdatePod] Error: failed to delete pod from label ipset with err: %w" , err )
444419 }
@@ -452,7 +427,6 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
452427
453428 // Add the pod to its label's ipset.
454429 for _ , addIPSetName := range addToIPSets {
455- klog .Infof ("Adding pod %s to ipset %s" , newPodObj .Status .PodIP , addIPSetName )
456430 if err = c .ipsMgr .AddToSet (addIPSetName , newPodObj .Status .PodIP , util .IpsetNetHashFlag , podKey ); err != nil {
457431 return metrics .UpdateOp , fmt .Errorf ("[syncAddAndUpdatePod] Error: failed to add pod to label ipset with err: %w" , err )
458432 }
@@ -495,7 +469,6 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
495469
496470// cleanUpDeletedPod cleans up all ipset associated with this pod
497471func (c * PodController ) cleanUpDeletedPod (cachedNpmPodKey string ) error {
498- klog .Infof ("[cleanUpDeletedPod] deleting Pod with key %s" , cachedNpmPodKey )
499472 // If cached npmPod does not exist, return nil
500473 cachedNpmPod , exist := c .podMap [cachedNpmPodKey ]
501474 if ! exist {
@@ -511,13 +484,11 @@ func (c *PodController) cleanUpDeletedPod(cachedNpmPodKey string) error {
511484
512485 // Get lists of podLabelKey and podLabelKey + podLavelValue ,and then start deleting them from ipsets
513486 for labelKey , labelVal := range cachedNpmPod .Labels {
514- klog .Infof ("Deleting pod %s from ipset %s" , cachedNpmPod .PodIP , labelKey )
515487 if err = c .ipsMgr .DeleteFromSet (labelKey , cachedNpmPod .PodIP , cachedNpmPodKey ); err != nil {
516488 return fmt .Errorf ("[cleanUpDeletedPod] Error: failed to delete pod from label ipset with err: %w" , err )
517489 }
518490
519491 podIPSetName := util .GetIpSetFromLabelKV (labelKey , labelVal )
520- klog .Infof ("Deleting pod %s from ipset %s" , cachedNpmPod .PodIP , podIPSetName )
521492 if err = c .ipsMgr .DeleteFromSet (podIPSetName , cachedNpmPod .PodIP , cachedNpmPodKey ); err != nil {
522493 return fmt .Errorf ("[cleanUpDeletedPod] Error: failed to delete pod from label ipset with err: %w" , err )
523494 }
@@ -538,7 +509,6 @@ func (c *PodController) cleanUpDeletedPod(cachedNpmPodKey string) error {
538509func (c * PodController ) manageNamedPortIpsets (portList []corev1.ContainerPort , podKey string ,
539510 podIP string , namedPortOperation NamedPortOperation ) error {
540511 for _ , port := range portList {
541- klog .Infof ("port is %+v" , port )
542512 if port .Name == "" {
543513 continue
544514 }
0 commit comments