Add top level log for syncing/deleting l4netlb service
@@ -426,6 +426,12 @@ func (lc *L4NetLBController) syncInternal(service *v1.Service) *loadbalancers.L4
return nil
}
+ startTime := time.Now()
+ klog.Infof("Syncing L4 NetLB RBS service %s/%s", service.Namespace, service.Name)
+ defer func() {
+ klog.Infof("Finished syncing L4 NetLB RBS service %s/%s, time taken: %v", service.Namespace, service.Name, time.Since(startTime))
+ }()
+
if err := common.EnsureServiceFinalizer(service, common.NetLBFinalizerV2, lc.ctx.KubeClient); err != nil {
return &loadbalancers.L4NetLBSyncResult{Error: fmt.Errorf("Failed to attach L4 External LoadBalancer finalizer to service %s/%s, err %w", service.Namespace, service.Name, err)}
}
@@ -519,6 +525,12 @@ func (lc *L4NetLBController) ensureInstanceGroups(service *v1.Service, nodeNames
// garbageCollectRBSNetLB cleans-up all gce resources related to service and removes NetLB finalizer
func (lc *L4NetLBController) garbageCollectRBSNetLB(key string, svc *v1.Service) *loadbalancers.L4NetLBSyncResult {
+ startTime := time.Now()
+ klog.Infof("Deleting L4 NetLB RBS service %s/%s", svc.Namespace, svc.Name)
+ defer func() {
+ klog.Infof("Finished deleting L4 NetLB service %s/%s, time taken: %v", svc.Namespace, svc.Name, time.Since(startTime))
+ }()
+
l4NetLBParams := &loadbalancers.L4NetLBParams{
Service: svc,
Cloud: lc.ctx.Cloud,
