mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #82029 from losipiuk/lo/runners-scalability
Allow relaxing deleted pods checking in RC runner
This commit is contained in:
commit
d62ebe31f0
@ -160,6 +160,9 @@ type RCConfig struct {
|
|||||||
// Maximum allowable container failures. If exceeded, RunRC returns an error.
|
// Maximum allowable container failures. If exceeded, RunRC returns an error.
|
||||||
// Defaults to replicas*0.1 if unspecified.
|
// Defaults to replicas*0.1 if unspecified.
|
||||||
MaxContainerFailures *int
|
MaxContainerFailures *int
|
||||||
|
// Maximum allowed pod deletions count. If exceeded, RunRC returns an error.
|
||||||
|
// Defaults to 0.
|
||||||
|
MaxAllowedPodDeletions int
|
||||||
|
|
||||||
// If set to false starting RC will print progress, otherwise only errors will be printed.
|
// If set to false starting RC will print progress, otherwise only errors will be printed.
|
||||||
Silent bool
|
Silent bool
|
||||||
@ -787,6 +790,7 @@ func (config *RCConfig) start() error {
|
|||||||
oldPods := make([]*v1.Pod, 0)
|
oldPods := make([]*v1.Pod, 0)
|
||||||
oldRunning := 0
|
oldRunning := 0
|
||||||
lastChange := time.Now()
|
lastChange := time.Now()
|
||||||
|
podDeletionsCount := 0
|
||||||
for oldRunning != config.Replicas {
|
for oldRunning != config.Replicas {
|
||||||
time.Sleep(interval)
|
time.Sleep(interval)
|
||||||
|
|
||||||
@ -817,9 +821,10 @@ func (config *RCConfig) start() error {
|
|||||||
|
|
||||||
diff := Diff(oldPods, pods)
|
diff := Diff(oldPods, pods)
|
||||||
deletedPods := diff.DeletedPods()
|
deletedPods := diff.DeletedPods()
|
||||||
if len(deletedPods) != 0 {
|
podDeletionsCount += len(deletedPods)
|
||||||
// There are some pods that have disappeared.
|
if podDeletionsCount > config.MaxAllowedPodDeletions {
|
||||||
err := fmt.Errorf("%d pods disappeared for %s: %v", len(deletedPods), config.Name, strings.Join(deletedPods, ", "))
|
// Number of pods which disappeared is over threshold
|
||||||
|
err := fmt.Errorf("%d pods disappeared for %s: %v", podDeletionsCount, config.Name, strings.Join(deletedPods, ", "))
|
||||||
config.RCConfigLog(err.Error())
|
config.RCConfigLog(err.Error())
|
||||||
config.RCConfigLog(diff.String(sets.NewString()))
|
config.RCConfigLog(diff.String(sets.NewString()))
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user