Skip to content

Commit

Permalink
gke: allow customization of autoscaling strategy
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Apr 12, 2024
1 parent 160cf28 commit 4123aa8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions kubescaler/scaler/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kubescaler/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: (MIT)

__version__ = "0.0.19"
__version__ = "0.0.2"
AUTHOR = "Vanessa Sochat"
EMAIL = "[email protected]"
NAME = "kubescaler"
Expand Down

0 comments on commit 4123aa8

Please sign in to comment.