Log available pods of deployments when scaling down old RS

This commit is contained in:
Janet Kuo
2016-07-06 13:31:28 -07:00
parent 8c8c5d97ca
commit 08305f12a2
2 changed files with 3 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ func (dc *DeploymentController) reconcileOldReplicaSets(allRSs []*extensions.Rep
if err != nil {
return false, fmt.Errorf("could not find available pods: %v", err)
}
glog.V(4).Infof("New RS %s/%s has %d available pods.", newRS.Namespace, newRS.Name, newRSAvailablePodCount)
maxUnavailable := maxUnavailable(*deployment)
// Check if we can scale down. We can scale down in the following 2 cases:
@@ -172,6 +173,7 @@ func (dc *DeploymentController) cleanupUnhealthyReplicas(oldRSs []*extensions.Re
if err != nil {
return nil, totalScaledDown, fmt.Errorf("could not find available pods: %v", err)
}
glog.V(4).Infof("Found %d available pods in old RS %s/%s", availablePodCount, targetRS.Namespace, targetRS.Name)
if targetRS.Spec.Replicas == availablePodCount {
// no unhealthy replicas found, no scaling required.
continue

View File

@@ -356,6 +356,7 @@ func countAvailablePods(pods []api.Pod, minReadySeconds int32) int32 {
for _, pod := range pods {
// TODO: Make the time.Now() as argument to allow unit test this.
if IsPodAvailable(&pod, minReadySeconds, time.Now()) {
glog.V(4).Infof("Pod %s/%s is available.", pod.Namespace, pod.Name)
availablePodCount++
}
}