Set reason and message on Pod during nodecontroller eviction

Pods which are evicted by the nodecontroller due to network
malfunction, or unresponsive kubelet should be differentiated
from termination initiated by other sources. The reason/message
are consumed by kubectl to provide a better summary using get/describe.
This commit is contained in:
Anirudh
2016-11-01 12:59:06 -07:00
parent 758c56cc85
commit a5bdc5f509
3 changed files with 51 additions and 3 deletions

View File

@@ -31,6 +31,13 @@ import (
"k8s.io/kubernetes/pkg/types"
)
const (
// The reason and message set on a pod when its state cannot be confirmed as kubelet is unresponsive
// on the node it is (was) running.
NodeUnreachablePodReason = "NodeLost"
NodeUnreachablePodMessage = "Node %v which was running pod %v is unresponsive"
)
func GetHostname(hostnameOverride string) string {
var hostname string = hostnameOverride
if hostname == "" {