Skip to content

Commit

Permalink
Use highest available magnum microversion
Browse files Browse the repository at this point in the history
Magnum allows using the microversion string "latest",
and it will replace it internally with the highest
microversion that it supports.

This will let the autoscaler use microversion 1.10 which
allows scaling groups to 0 nodes, if it is available.

The autoscaler will still be able to use microversion 1.9
on older versions of magnum.
  • Loading branch information
tghartland committed Aug 13, 2021
1 parent 0df0eec commit 13cd70e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cluster-autoscaler/cloudprovider/magnum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ using the cluster autoscaler v1.18 or lower.

## Updates

* CA 1.22
* Allow scaling node groups to 0 nodes, if supported (requires Magnum Wallaby).
* CA 1.19
* Update to support Magnum node groups (introduced in Magnum Train).
* Add node group autodiscovery based on the group's role property.
Expand Down
6 changes: 5 additions & 1 deletion cluster-autoscaler/cloudprovider/magnum/magnum_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import (
const (
// Magnum microversion that must be requested to use the node groups API.
microversionNodeGroups = "1.9"
// Magnum microversion that must be requested to support scaling node groups to 0 nodes.
microversionScaleToZero = "1.10"
// Magnum interprets "latest" to mean the highest available microversion.
microversionLatest = "latest"
)

// magnumManager is an interface for the basic interactions with the cluster.
Expand Down Expand Up @@ -61,7 +65,7 @@ func createMagnumManager(configReader io.Reader, discoverOpts cloudprovider.Node
return nil, err
}

clusterClient.Microversion = microversionNodeGroups
clusterClient.Microversion = microversionLatest

// This replaces the cluster name with a UUID if the name was given in the parameters.
err = checkClusterUUID(provider, clusterClient, opts)
Expand Down

0 comments on commit 13cd70e

Please sign in to comment.