eviction message now includes resource that was exhausted

pull/6/head
David Ashpole 2016-11-04 09:30:02 -07:00
parent 9aca40dee6
commit d68572e581
2 changed files with 5 additions and 4 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
package eviction
import (
"fmt"
"sort"
"sync"
"time"
@ -113,7 +114,7 @@ func (m *managerImpl) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAd
return lifecycle.PodAdmitResult{
Admit: false,
Reason: reason,
Message: message,
Message: fmt.Sprintf(message, m.nodeConditions),
}
}
@ -254,11 +255,11 @@ func (m *managerImpl) synchronize(diskInfoProvider DiskInfoProvider, podFunc Act
pod := activePods[i]
status := api.PodStatus{
Phase: api.PodFailed,
Message: message,
Message: fmt.Sprintf(message, resourceToReclaim),
Reason: reason,
}
// record that we are evicting the pod
m.recorder.Eventf(pod, api.EventTypeWarning, reason, message)
m.recorder.Eventf(pod, api.EventTypeWarning, reason, fmt.Sprintf(message, resourceToReclaim))
gracePeriodOverride := int64(0)
if softEviction {
gracePeriodOverride = m.config.MaxPodGracePeriodSeconds

View File

@ -38,7 +38,7 @@ const (
// the reason reported back in status.
reason = "Evicted"
// the message associated with the reason.
message = "The node was low on compute resources."
message = "The node was low on resource: %v."
// disk, in bytes. internal to this module, used to account for local disk usage.
resourceDisk api.ResourceName = "disk"
// inodes, number. internal to this module, used to account for local disk inode consumption.