mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
kubelet: reject pods on host port conflict
When a host port conflict is detected, kubelet should set the pod status to fail. The failed status will then be polled by other components at a later time, which allows replication controller to create a new pod if necessary. To achieve this, this change stores the pod status information in a status map upon the detecton of port conflict. GetPodStatus() consults this status map before attempting to query docker. The entries in the status map will be removed when the pod is no longer associated with the node.
This commit is contained in:
@@ -55,7 +55,7 @@ func (kl *Kubelet) runOnce(pods []api.BoundPod) (results []RunPodResult, err err
|
||||
if kl.dockerPuller == nil {
|
||||
kl.dockerPuller = dockertools.NewDockerPuller(kl.dockerClient, kl.pullQPS, kl.pullBurst)
|
||||
}
|
||||
pods = kl.filterHostPortConflicts(pods)
|
||||
kl.handleHostPortConflicts(pods)
|
||||
|
||||
ch := make(chan RunPodResult)
|
||||
for i := range pods {
|
||||
|
Reference in New Issue
Block a user