Skip to content

Commit 4c55b17

Browse files
authored
Merge pull request #5695 from kawych/tpu
Add atomic scale down option for node groups
2 parents 973f9fd + 753b024 commit 4c55b17

File tree

13 files changed

+1721
-622
lines changed

13 files changed

+1721
-622
lines changed

cluster-autoscaler/cloudprovider/test/test_cloud_provider.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ func (tng *TestNodeGroup) DeleteNodes(nodes []*apiv1.Node) error {
443443
id := tng.id
444444
tng.targetSize -= len(nodes)
445445
tng.Unlock()
446+
if tng.opts != nil && tng.opts.AtomicScaling && tng.targetSize != 0 {
447+
return fmt.Errorf("TestNodeGroup: attempted to partially scale down a node group that should be scaled down atomically")
448+
}
446449
for _, node := range nodes {
447450
err := tng.cloudProvider.onScaleDown(id, node.Name)
448451
if err != nil {

cluster-autoscaler/config/autoscaling_options.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ type NodeGroupAutoscalingOptions struct {
4646
ScaleDownUnreadyTime time.Duration
4747
// Maximum time CA waits for node to be provisioned
4848
MaxNodeProvisionTime time.Duration
49+
// AtomicScaling means that all nodes should be provisioned and brought down all at once instead of one-by-one
50+
AtomicScaling bool
4951
}
5052

5153
// GCEOptions contain autoscaling options specific to GCE cloud provider.

cluster-autoscaler/core/scaledown/actuation/actuator.go

Lines changed: 73 additions & 184 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)