diff --git a/pkg/kubelet/kuberuntime/kuberuntime_manager.go b/pkg/kubelet/kuberuntime/kuberuntime_manager.go index fff809dae9c..9da4737359b 100644 --- a/pkg/kubelet/kuberuntime/kuberuntime_manager.go +++ b/pkg/kubelet/kuberuntime/kuberuntime_manager.go @@ -396,6 +396,12 @@ func (m *kubeGenericRuntimeManager) podSandboxChanged(pod *v1.Pod, podStatus *ku return true, sandboxStatus.Metadata.Attempt + 1, "" } + // Needs to create a new sandbox when the sandbox does not have an IP address. + if !kubecontainer.IsHostNetworkPod(pod) && sandboxStatus.Network.Ip == "" { + glog.V(2).Infof("Sandbox for pod %q has no IP address. Need to start a new one", format.Pod(pod)) + return true, sandboxStatus.Metadata.Attempt + 1, sandboxStatus.Id + } + return false, sandboxStatus.Metadata.Attempt, sandboxStatus.Id } diff --git a/pkg/kubelet/pleg/generic.go b/pkg/kubelet/pleg/generic.go index 8e447f0ef85..e12509f4b54 100644 --- a/pkg/kubelet/pleg/generic.go +++ b/pkg/kubelet/pleg/generic.go @@ -177,7 +177,7 @@ func (g *GenericPLEG) updateRelisTime(timestamp time.Time) { } // relist queries the container runtime for list of pods/containers, compare -// with the internal pods/containers, and generats events accordingly. +// with the internal pods/containers, and generates events accordingly. func (g *GenericPLEG) relist() { glog.V(5).Infof("GenericPLEG: Relisting")