From 3cc9b195d3964491983063a669af60037490dd63 Mon Sep 17 00:00:00 2001 From: okozachenko1203 Date: Tue, 14 Nov 2023 01:44:34 +1100 Subject: [PATCH] fix: Set MachineDeployment replicas as min node count when autoscale enabled --- magnum_cluster_api/resources.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/magnum_cluster_api/resources.py b/magnum_cluster_api/resources.py index fb2af74f..3df8afda 100644 --- a/magnum_cluster_api/resources.py +++ b/magnum_cluster_api/resources.py @@ -1671,7 +1671,9 @@ def generate_machine_deployments_for_cluster( { "class": "default-worker", "name": ng.name, - "replicas": None if auto_scaling_enabled else ng.node_count, + "replicas": utils.get_node_group_min_node_count(ng) + if auto_scaling_enabled + else ng.node_count, "metadata": { "annotations": { AUTOSCALE_ANNOTATION_MIN: f"{utils.get_node_group_min_node_count(ng)}", # noqa: E501