Skip to content

Commit 2cf007f

Browse files
hubatishcopybara-github
authored andcommitted
Clamp desired capacity to between min & max node count for the default nodepool
PiperOrigin-RevId: 834505535
1 parent f0a78db commit 2cf007f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

perfkitbenchmarker/providers/aws/elastic_kubernetes_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ def _RenderNodeGroupJson(
185185
# Min / max config only apply to the default nodepool.
186186
group_json['minSize'] = self.min_nodes
187187
group_json['maxSize'] = self.max_nodes
188+
group_json['desiredCapacity'] = min(
189+
max(self.min_nodes, nodepool.num_nodes), self.max_nodes
190+
)
188191
return group_json
189192

190193
def _WriteJsonToFile(self, json_dict: dict[str, Any]) -> str:

0 commit comments

Comments
 (0)