Skip to content

Commit

Permalink
fix: deploy autoscaler right before the cluster creation completed (#307
Browse files Browse the repository at this point in the history
)
  • Loading branch information
okozachenko1203 authored Feb 8, 2024
1 parent c40f848 commit a48ddef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion magnum_cluster_api/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def create_cluster(self, context, cluster, cluster_create_timeout):
context, self.k8s_api, cluster
).apply()

resources.apply_cluster_from_magnum_cluster(context, self.k8s_api, cluster)
resources.apply_cluster_from_magnum_cluster(
context, self.k8s_api, cluster, skip_auto_scaling_release=True
)

def _get_cluster_status_reason(self, capi_cluster):
capi_cluster_status_reason = ""
Expand Down Expand Up @@ -127,6 +129,14 @@ def update_cluster_status(self, context, cluster, use_admin_ctx=False):
)
cluster.coe_version = capi_cluster.obj["spec"]["topology"]["version"]

# NOTE(oleks): To avoid autoscaler crashes, we deploy it after the
# cluster api endpoint is reachable.
if (
cluster.status == "CREATE_IN_PROGRESS"
and utils.get_auto_scaling_enabled(cluster)
):
resources.ClusterAutoscalerHelmRelease(self.k8s_api, cluster).apply()

for ng in node_groups:
if not ng.status.endswith("_COMPLETE"):
return
Expand Down

0 comments on commit a48ddef

Please sign in to comment.