diff --git a/internal/status-updater/app.go b/internal/status-updater/app.go index 3e58bf5..fc28ce9 100644 --- a/internal/status-updater/app.go +++ b/internal/status-updater/app.go @@ -51,6 +51,8 @@ func (app *StatusUpdaterApp) Init(stopCh chan struct{}) { app.stopCh = stopCh clusterConfig := InClusterConfigFn() + clusterConfig.QPS = 100 + clusterConfig.Burst = 200 app.wg = &sync.WaitGroup{} diff --git a/internal/status-updater/controllers/node/controller.go b/internal/status-updater/controllers/node/controller.go index bbe0cf1..30339c3 100644 --- a/internal/status-updater/controllers/node/controller.go +++ b/internal/status-updater/controllers/node/controller.go @@ -50,12 +50,16 @@ func NewNodeController(kubeClient kubernetes.Interface, wg *sync.WaitGroup) *Nod }, Handler: cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - node := obj.(*v1.Node) - util.LogErrorIfExist(c.handler.HandleAdd(node), "Failed to handle node addition") + go func() { + node := obj.(*v1.Node) + util.LogErrorIfExist(c.handler.HandleAdd(node), "Failed to handle node addition") + }() }, DeleteFunc: func(obj interface{}) { - node := obj.(*v1.Node) - util.LogErrorIfExist(c.handler.HandleDelete(node), "Failed to handle node deletion") + go func() { + node := obj.(*v1.Node) + util.LogErrorIfExist(c.handler.HandleDelete(node), "Failed to handle node deletion") + }() }, }, })