kubelet: move all node status related methods to a separate file

The methods for registering a node and syncing node status to the apiserver
have grown large enough that it makes sense for them to live in a separate
place. This change adds a nodeManager to handle such interaction with the
apiserver.
This commit is contained in:
Yu-Ju Hong
2015-09-16 14:55:52 -07:00
parent 4c46bc3243
commit e7d1e47f31
3 changed files with 486 additions and 371 deletions

View File

@@ -95,7 +95,7 @@ type HostInterface interface {
GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisorApi.ContainerInfoRequest) (*cadvisorApi.ContainerInfo, error)
GetContainerRuntimeVersion() (kubecontainer.Version, error)
GetRawContainerInfo(containerName string, req *cadvisorApi.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorApi.ContainerInfo, error)
GetCachedMachineInfo() (*cadvisorApi.MachineInfo, error)
GetMachineInfo() (*cadvisorApi.MachineInfo, error)
GetPods() []*api.Pod
GetRunningPods() ([]*api.Pod, error)
GetPodByName(namespace, name string) (*api.Pod, bool)
@@ -407,7 +407,7 @@ func (s *Server) getLogs(request *restful.Request, response *restful.Response) {
// getSpec handles spec requests against the Kubelet.
func (s *Server) getSpec(request *restful.Request, response *restful.Response) {
info, err := s.host.GetCachedMachineInfo()
info, err := s.host.GetMachineInfo()
if err != nil {
response.WriteError(http.StatusInternalServerError, err)
return