-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubelet to fail pods that have hostPort conflicts, etc #4623
Comments
This would be a good project for someone who wants to get started in kubelet. |
You could e2e test this as follows. Create a pod in the API that requests the same hostPort as is already used by the file-based cadvisor container. The pod should fail and there should be an appropriate reason. |
@dchen1107 we just talked about this. |
in future we might use this to fail due to out of resources, or other setup errors. |
Might need some way to poison the node from future scheduling decisions - tricky. |
+1 to this, do want
|
@thockin
|
Oh, I thought this was getting rid of HostPort conflict checking entirely? On Thu, Feb 19, 2015 at 4:30 PM, Eric Tune notifications@github.com wrote:
|
This is needed in order to eliminate BoundPods. |
kubelet now sorts the pods before filtering, and also records an event on host port conflict. To actually reject such pods, we will need to kubelet to post pod status back to apiserver (#4561) |
The scheduler still checks. This handles parallel scheduler races and file
|
There should be no parallel scheduler races, we use resource versions and Brendan
|
Re. atomicity -- I don't buy that we need it. I commented here: #2483 (comment) |
@erictune, do you mean that we should still set the pod status to "failed" so that when the scheduler check, it can get the accurate pod status back? I had thought about it, but the pod statuses are computed on the fly (by checking the containers) as of now. Without the ability to directly set the status, we need to cache this information somewhere. Since there are people touching the same code/file, I'd rather wait until #4561 is fixed. |
@brendandburns
|
@erictune and I discussed offline, and we decided to create a map to store the rejected pod->status, so that the failed status will be correctly reports when polling happens. By doing this, this issue is no longer blocked by any other issues. I will write up a PR to implement this. |
Although the scheduler tries not to coschedule pods with hostPort conflicts, there could still be a conflict:
Right now, kubelet can detect a conflict, via the code in syncLoop, in pkg/kubelet/kubelet.go, where it calls filterHostPortConflicts(). However, two things need to change in that loop.
First, instead of just ignoring one of the two conflicting pods, the kubelet should immediately set the pod status to Failed with an event with a useful Reason. It should do this even for pods which requested restarting.
Second, it should do this in a deterministic way. Right now, it is based on the order of the items as they come out of the config code. Maybe it should iterate through the pods by creation timestamp.
The text was updated successfully, but these errors were encountered: