diff --git a/magnum_cluster_api/driver.py b/magnum_cluster_api/driver.py index 35c76072..a89b8953 100644 --- a/magnum_cluster_api/driver.py +++ b/magnum_cluster_api/driver.py @@ -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 = "" @@ -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