-
Notifications
You must be signed in to change notification settings - Fork 306
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
Added NoSchedule effect to GetNodeConditionPredicate #792
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,9 @@ const ( | |
// This label is feature-gated in kubernetes/kubernetes but we do not have feature gates | ||
// This will need to be updated after the end of the alpha | ||
LabelNodeRoleExcludeBalancer = "alpha.service-controller.kubernetes.io/exclude-balancer" | ||
// ToBeDeletedTaint is the taint that the autoscaler adds when a node is scheduled to be deleted | ||
// https://github.com/kubernetes/autoscaler/blob/cluster-autoscaler-0.5.2/cluster-autoscaler/utils/deletetaint/delete.go#L33 | ||
ToBeDeletedTaint = "ToBeDeletedByClusterAutoscaler" | ||
) | ||
|
||
// FakeGoogleAPIForbiddenErr creates a Forbidden error with type googleapi.Error | ||
|
@@ -319,6 +322,13 @@ func GetNodeConditionPredicate() listers.NodeConditionPredicate { | |
return false | ||
} | ||
|
||
// Get all nodes that have a taint with NoSchedule effect | ||
for _, taint := range node.Spec.Taints { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like it should not be this generic. It should be limited to the autoscaler's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds better, I'll change it. |
||
if taint.Key == ToBeDeletedTaint { | ||
return false | ||
} | ||
} | ||
|
||
// As of 1.6, we will taint the master, but not necessarily mark it unschedulable. | ||
// Recognize nodes labeled as master, and filter them also, as we were doing previously. | ||
if _, hasMasterRoleLabel := node.Labels[LabelNodeRoleMaster]; hasMasterRoleLabel { | ||
|
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.
Is there any public documentation regarding this taint?
If not, probably still need to add a link to the autoscaler repo.
https://github.com/kubernetes/autoscaler/blob/cluster-autoscaler-0.5.2/cluster-autoscaler/utils/deletetaint/delete.go#L33
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.
@freehan I didn't find any docs on it :/
I'll try to vendor it and its dependencies.
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.
If there is tons of dependencies, just add the link in the comment then. No need for the hustle.