Prioritize deleting the non-running pods when reducing replicas

This changes instructs the replication controller to delete replicas in the
order of "unscheduled (pending)", "scheduled (pending)", and "scheduled
(running)" pods. This is less disruptive than deleting random pods.
This commit is contained in:
Yu-Ju Hong
2015-04-16 17:37:57 -07:00
parent b944049fe9
commit df2cbd4877
4 changed files with 104 additions and 22 deletions

View File

@@ -315,14 +315,7 @@ func (e *EndpointController) syncService(key string) {
continue
}
inService := false
for _, c := range pod.Status.Conditions {
if c.Type == api.PodReady && c.Status == api.ConditionTrue {
inService = true
break
}
}
if !inService {
if !api.IsPodReady(pod) {
glog.V(5).Infof("Pod is out of service: %v/%v", pod.Namespace, pod.Name)
continue
}