diff --git a/CHANGELOG.md b/CHANGELOG.md index 964b725..79660e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are: The versions coincide with releases on pip. Only major versions will be released as tags on Github. ## [0.0.x](https://github.com/converged-computing/kubescaler/tree/main) (0.0.x) + - allow customization of autoscaling (0.0.2) - ensure we do not add size for node scaling up/down times (0.0.19) - do not use the waiter for nodegroup_active it does not work! (0.0.18) - support for Google Cloud instance group creation, etc. diff --git a/kubescaler/scaler/google.py b/kubescaler/scaler/google.py index b7a1785..1b3a4a9 100644 --- a/kubescaler/scaler/google.py +++ b/kubescaler/scaler/google.py @@ -307,16 +307,18 @@ def delete_nodegroup(self, name=None): self.client.delete_node_pool(request=request) return self.wait_for_status(2) - def get_cluster(self, node_pools=None): + def get_cluster(self, node_pools=None, scaling_profile=1): """ Get the cluster proto with our defaults """ + if scaling_profile not in [0, 1, 2]: + raise ValueError("Scaling profile must be one of 0,1,2") # Design our initial cluster! # Autoscaling - try optimizing # PROFILE_UNSPECIFIED = 0 # OPTIMIZE_UTILIZATION = 1 # BALANCED = 2 - autoscaling_profile = container_v1.ClusterAutoscaling.AutoscalingProfile(1) + autoscaling_profile = container_v1.ClusterAutoscaling.AutoscalingProfile(scaling_profile) # These are required, you get an error without them. # https://cloud.google.com/compute/docs/compute-optimized-machines diff --git a/kubescaler/version.py b/kubescaler/version.py index e139094..18b6188 100644 --- a/kubescaler/version.py +++ b/kubescaler/version.py @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: (MIT) -__version__ = "0.0.19" +__version__ = "0.0.2" AUTHOR = "Vanessa Sochat" EMAIL = "vsoch@users.noreply.github.com" NAME = "kubescaler"