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
Add Host to PodSpec and add a predicate to make the scheduler work. #3043
Conversation
Tests fixed. |
Context for others: #3020, #1518. @smarterclayton @lavalamp @markturansky After asking for Host to be moved to Status, I've proposed putting it in Spec, to facilitate "scheduling" by users and controllers, the per-node controller in particular in this case. Internally, we use constraints for that, but that approach has a number of problems. Making it explicit is clearer for users and enables a fast path in the system (for now, in the scheduler). |
@@ -162,6 +162,13 @@ func (n *NodeSelector) PodSelectorMatches(pod api.Pod, existingPods []api.Pod, n | |||
return selector.Matches(labels.Set(minion.Labels)), nil | |||
} | |||
|
|||
func PodFitsHost(pod api.Pod, existingPods []api.Pod, node string) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go ahead and add this to the default predicates:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go#L31
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bgrant0607 would this be a good way to format newly attached GCEPDs/EBS volumes? In #2609 I suggested having kubelet format a newly attached disk before mounting the filesystem. I can see a per-node controller performing this action instead. It could effectively throttle the number of concurrent formatting operations and prevent the host from getting crushed.
Your feedback and advice on #2609 would be invaluable :)
Setting the host in Spec would also easily accommodate the hostDir example laid out in #1515.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markturansky I'll take a look at the other PRs.
push changes? |
LGTM |
I can haz mergez? |
Add Host to PodSpec and add a predicate to make the scheduler work.
No description provided.