-
Notifications
You must be signed in to change notification settings - Fork 38
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
UPSTREAM: <carry>: openshift: return no nodegroup when scaling size is zero #42
UPSTREAM: <carry>: openshift: return no nodegroup when scaling size is zero #42
Conversation
@@ -415,6 +421,12 @@ func (c *machineController) nodeGroupForNode(node *apiv1.Node) (cloudprovider.No | |||
return nil, fmt.Errorf("failed to build nodegroup for node %q: %v", node.Name, err) | |||
} | |||
|
|||
// We don't scale from 0 so nodes must belong to a nodegroup | |||
// that has a scale size of at least 1. | |||
if nodegroup.MaxSize()-nodegroup.MinSize() < 1 { |
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.
Can you also add a testcase where you set both sizes to be equal and verify you get nil node group?
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.
Test cases now covered in TestControllerNodeGroupForNodeLookup()
- 56bc385
/test e2e-aws-operator |
dd031b3
to
eec7f96
Compare
ce7f209
to
084f847
Compare
These will be used/shared by the controller tests.
084f847
to
efc492b
Compare
/lgtm |
/hold |
efc492b
to
90f408b
Compare
/hold cancel |
90f408b
to
f313586
Compare
/hold |
/hold cancel |
… == 0 Change nodeGroupForNode() to return nil when the underlying node group has no scaling bounds. The underlying MachineSet in these cases is either missing the following annotations: ``` annotations: machine.openshift.io/cluster-api-autoscaler-node-group-min-size: "1" machine.openshift.io/cluster-api-autoscaler-node-group-max-size: "6" ``` or they are present but the result of `max-size - min-size` is zero. This change helps to remove a lot of spurious error messages from the core of the autoscaler logs at runtime. Without this change we see the following printed every time the autoscaler scans the state of the cluster (which defaults to 10s) and can be very misleading. ```console $ oc logs -f cluster-autoscaler-default-77f884d74b-527bq E1204 08:26:01.996252 1 utils.go:467] Error while checking node group size worker-us-east-2a: group size not found E1204 08:26:01.996545 1 utils.go:467] Error while checking node group size worker-us-east-2b: group size not found E1204 08:26:01.996678 1 utils.go:467] Error while checking node group size worker-us-east-2c: group size not found ``` Those unit tests that were previously relying on nodeGroupForNode() to always return a node group when no bounds had been specified have been modified so that they now have a scaling bound >= 1. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1656334
These are now covered by TestControllerNodeGroupForNodeLookup
f313586
to
d64b32a
Compare
/lgtm Thanks for the improvements |
Change nodeGroupForNode() to return nil when the underlying node group
has no scaling bounds. The underlying MachineSet in these cases is
either missing the following annotations:
or they are present but the result of
max-size - min-size
is zero.This change helps to remove a lot of spurious error messages from the
core of the autoscaler logs at runtime. Without this change we see the
following printed every time the autoscaler scans the state of the
cluster (which defaults to 10s) and can be very misleading.
Those unit tests that were previously relying on nodeGroupForNode() to
always return a node group when no bounds had been specified have been
modified so that they now have a scaling bound >= 1.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1656334