Explicitly enqueue controllers on failures and increase resync period

This commit is contained in:
Wojciech Tyczynski 2016-05-16 08:52:01 +02:00
parent aada051b20
commit 626ff900ad

View File

@ -47,7 +47,11 @@ const (
// We'll attempt to recompute the required replicas of all replication controllers // We'll attempt to recompute the required replicas of all replication controllers
// that have fulfilled their expectations at least this often. This recomputation // that have fulfilled their expectations at least this often. This recomputation
// happens based on contents in local pod storage. // happens based on contents in local pod storage.
FullControllerResyncPeriod = 30 * time.Second // Full Resync shouldn't be needed at all in a healthy system. This is a protection
// against disappearing objects and watch notification, that we believe should not
// happen at all.
// TODO: We should get rid of it completely in the fullness of time.
FullControllerResyncPeriod = 10 * time.Minute
// Realistic value of the burstReplica field for the replication manager based off // Realistic value of the burstReplica field for the replication manager based off
// performance requirements for kubernetes 1.0. // performance requirements for kubernetes 1.0.
@ -477,6 +481,7 @@ func (rm *ReplicationManager) manageReplicas(filteredPods []*api.Pod, rc *api.Re
// Decrement the expected number of creates because the informer won't observe this pod // Decrement the expected number of creates because the informer won't observe this pod
glog.V(2).Infof("Failed creation, decrementing expectations for controller %q/%q", rc.Namespace, rc.Name) glog.V(2).Infof("Failed creation, decrementing expectations for controller %q/%q", rc.Namespace, rc.Name)
rm.expectations.CreationObserved(rcKey) rm.expectations.CreationObserved(rcKey)
rm.enqueueController(rc)
utilruntime.HandleError(err) utilruntime.HandleError(err)
} }
}() }()
@ -518,6 +523,7 @@ func (rm *ReplicationManager) manageReplicas(filteredPods []*api.Pod, rc *api.Re
podKey := controller.PodKey(filteredPods[ix]) podKey := controller.PodKey(filteredPods[ix])
glog.V(2).Infof("Failed to delete %v due to %v, decrementing expectations for controller %q/%q", podKey, err, rc.Namespace, rc.Name) glog.V(2).Infof("Failed to delete %v due to %v, decrementing expectations for controller %q/%q", podKey, err, rc.Namespace, rc.Name)
rm.expectations.DeletionObserved(rcKey, podKey) rm.expectations.DeletionObserved(rcKey, podKey)
rm.enqueueController(rc)
utilruntime.HandleError(err) utilruntime.HandleError(err)
} }
}(i) }(i)