Skip to content

Commit d17656c

Browse files
hubatishcopybara-github
authored andcommitted
Only enable-cluster-auto-scaler on nodepools when not using auto node provisioning
The two modes are exclusive to each other. This corrects an error from #6414 introducing cluster auto scaler on nodepools. PiperOrigin-RevId: 895571245
1 parent 6617c10 commit d17656c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

perfkitbenchmarker/providers/azure/azure_kubernetes_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ def _IsAutoscalerEnabled(self):
154154
return (
155155
self.min_nodes != self.default_nodepool.num_nodes
156156
or self.max_nodes != self.default_nodepool.num_nodes
157-
)
157+
# Auto node provisioning mode is incompatible with cluster autoscaler.
158+
) and not FLAGS.azure_aks_auto_node_provisioning
158159

159160
def _Create(self):
160161
"""Creates the AKS cluster."""
@@ -270,9 +271,8 @@ def _GetNodeFlags(
270271
nodepool_config.machine_type,
271272
]
272273
node_count = nodepool_config.num_nodes
273-
if self._IsAutoscalerEnabled():
274-
node_count = max(self.min_nodes, node_count)
275-
node_count = min(self.max_nodes, node_count)
274+
node_count = max(self.min_nodes, node_count)
275+
node_count = min(self.max_nodes, node_count)
276276
args += [f'--node-count={node_count}']
277277
if self.default_nodepool.zone and self.default_nodepool.zone != self.region:
278278
zones = ' '.join(

0 commit comments

Comments
 (0)