Merge pull request #36892 from gmarek/nodecontroller

Automatic merge from submit-queue

Add logs near force deletions of Pods

We should always log something when control plane force deletes the Pod.

@davidopp I think that logging force deletions is enough, or do you think we should log soft deletions as well?

cc @deads2k
This commit is contained in:
Kubernetes Submit Queue 2016-11-20 16:00:10 -08:00 committed by GitHub
commit 0042ce5684
2 changed files with 2 additions and 0 deletions

View File

@ -118,6 +118,7 @@ func setPodTerminationReason(kubeClient clientset.Interface, pod *api.Pod, nodeN
func forcefullyDeletePod(c clientset.Interface, pod *api.Pod) error {
var zero int64
glog.Infof("NodeController is force deleting Pod: %v:%v", pod.Namespace, pod.Name)
err := c.Core().Pods(pod.Namespace).Delete(pod.Name, &api.DeleteOptions{GracePeriodSeconds: &zero})
if err == nil {
glog.V(4).Infof("forceful deletion of %s succeeded", pod.Name)

View File

@ -68,6 +68,7 @@ func NewPodGC(kubeClient clientset.Interface, podInformer cache.SharedIndexInfor
kubeClient: kubeClient,
terminatedPodThreshold: terminatedPodThreshold,
deletePod: func(namespace, name string) error {
glog.Infof("PodGC is force deleting Pod: %v:%v", namespace, name)
return kubeClient.Core().Pods(namespace).Delete(name, api.NewDeleteOptions(0))
},
}