Watch pods in executor and tell kubelet about graceful terminations

- instantiate framework.Controller for pods in the executor using framework.NewInformer,
  in order to watch pod updates for pods on that host
- forwards updates like graceful termination to the kubelet.

  This might also be the preparation for other updates which are supported by the
  kubelet.
This commit is contained in:
Dr. Stefan Schimanski
2015-09-17 13:51:38 +02:00
parent e4dcd97ac3
commit be57b2871e
2 changed files with 69 additions and 0 deletions

View File

@@ -36,8 +36,10 @@ import (
"k8s.io/kubernetes/contrib/mesos/pkg/hyperkube"
"k8s.io/kubernetes/contrib/mesos/pkg/redirfd"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/cache"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/credentialprovider"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/healthz"
"k8s.io/kubernetes/pkg/kubelet"
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
@@ -372,6 +374,7 @@ func (ks *KubeletExecutorServer) createAndInitKubelet(
return klet.GetRuntime().GetPodStatus(pod)
},
StaticPodsConfigPath: staticPodsConfigPath,
PodLW: cache.NewListWatchFromClient(kc.KubeClient, "pods", api.NamespaceAll, fields.OneTermEqualSelector(client.PodHost, kc.NodeName)),
})
go exec.InitializeStaticPodsSource(func() {