Skip to content

Commit

Permalink
Merge pull request kubernetes#5695 from kawych/tpu
Browse files Browse the repository at this point in the history
Add atomic scale down option for node groups
  • Loading branch information
k8s-ci-robot authored Jun 30, 2023
2 parents 973f9fd + 753b024 commit 4c55b17
Show file tree
Hide file tree
Showing 13 changed files with 1,721 additions and 622 deletions.
3 changes: 3 additions & 0 deletions cluster-autoscaler/cloudprovider/test/test_cloud_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ func (tng *TestNodeGroup) DeleteNodes(nodes []*apiv1.Node) error {
id := tng.id
tng.targetSize -= len(nodes)
tng.Unlock()
if tng.opts != nil && tng.opts.AtomicScaling && tng.targetSize != 0 {
return fmt.Errorf("TestNodeGroup: attempted to partially scale down a node group that should be scaled down atomically")
}
for _, node := range nodes {
err := tng.cloudProvider.onScaleDown(id, node.Name)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions cluster-autoscaler/config/autoscaling_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ type NodeGroupAutoscalingOptions struct {
ScaleDownUnreadyTime time.Duration
// Maximum time CA waits for node to be provisioned
MaxNodeProvisionTime time.Duration
// AtomicScaling means that all nodes should be provisioned and brought down all at once instead of one-by-one
AtomicScaling bool
}

// GCEOptions contain autoscaling options specific to GCE cloud provider.
Expand Down
257 changes: 73 additions & 184 deletions cluster-autoscaler/core/scaledown/actuation/actuator.go

Large diffs are not rendered by default.

Loading

0 comments on commit 4c55b17

Please sign in to comment.