diff --git a/controller/controller.go b/controller/controller.go index afe4bc769b..4a83e7341a 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -85,7 +85,7 @@ const ( DefaultIngressThreads = 10 // DefaultLeaderElect is the default true leader election should be enabled - DefaultLeaderElect = true + DefaultLeaderElect = false // DefaultLeaderElectionLeaseDuration is the default time in seconds that non-leader candidates will wait to force acquire leadership DefaultLeaderElectionLeaseDuration = 15 * time.Second diff --git a/rollout/controller.go b/rollout/controller.go index 75601661ca..95dbe87437 100644 --- a/rollout/controller.go +++ b/rollout/controller.go @@ -234,6 +234,8 @@ func NewController(cfg ControllerConfig) *Controller { controller.enqueueRollout(obj) ro := unstructuredutil.ObjectToRollout(obj) if ro != nil { + logCtx := logutil.WithRollout(ro) + logCtx.Info("rollout enqueue due to add event") if cfg.Recorder != nil { cfg.Recorder.Eventf(ro, record.EventOptions{ EventType: corev1.EventTypeNormal, @@ -258,12 +260,16 @@ func NewController(cfg ControllerConfig) *Controller { controller.IstioController.EnqueueDestinationRule(key) } } + if newRollout != nil { + logCtx := logutil.WithRollout(newRollout) + logCtx.Info("rollout enqueue due to update event") + } controller.enqueueRollout(new) }, DeleteFunc: func(obj interface{}) { if ro := unstructuredutil.ObjectToRollout(obj); ro != nil { logCtx := logutil.WithRollout(ro) - logCtx.Info("rollout deleted") + logCtx.Info("rollout enqueue due to delete event") controller.metricsServer.Remove(ro.Namespace, ro.Name, logutil.RolloutKey) // Rollout is deleted, queue up the referenced Service and/or DestinationRules so // that the rollouts-pod-template-hash can be cleared from each diff --git a/rollout/sync.go b/rollout/sync.go index 2baeac1698..100f318cf6 100644 --- a/rollout/sync.go +++ b/rollout/sync.go @@ -828,11 +828,13 @@ func (c *rolloutContext) requeueStuckRollout(newStatus v1alpha1.RolloutStatus) t // Make it ratelimited so we stay on the safe side, eventually the Deployment should // transition either to a Complete or to a TimedOut condition. if after < time.Second { - c.log.Infof("Queueing up Rollout for a progress check now") + logCtx := logutil.WithRollout(c.rollout) + logCtx.Info("rollout enqueue due to stuck event") c.enqueueRollout(c.rollout) return time.Duration(0) } - c.log.Infof("Queueing up rollout for a progress after %ds", int(after.Seconds())) + logCtx := logutil.WithRollout(c.rollout) + logCtx.Info("Queueing up rollout for a progress after %ds", int(after.Seconds())) // Add a second to avoid milliseconds skew in AddAfter. // See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info. c.enqueueRolloutAfter(c.rollout, after+time.Second)