Skip to content

Commit 9f1702a

Browse files
authored
Merge pull request #974 from gthao313/eksctl
eks-resource-agent: default ManagedNodeGroup desiredCapacity to 0
2 parents a8f6041 + 415255c commit 9f1702a

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

bottlerocket/agents/src/bin/eks-resource-agent/eks_provider.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ use strum_macros::EnumString;
3131
/// The default region for the cluster.
3232
const DEFAULT_REGION: &str = "us-west-2";
3333
/// The default cluster version.
34-
const DEFAULT_VERSION: &str = "1.24";
34+
const DEFAULT_VERSION: &str = "1.32";
3535
const TEST_CLUSTER_CONFIG_PATH: &str = "/local/eksctl_config.yaml";
3636
const CLUSTER_CONFIG_PATH: &str = "/local/cluster_config.yaml";
37+
/// The default cluster managed node group values.
38+
const MNG_MIN_SIZE: i32 = 0;
39+
const MNG_MAX_SIZE: i32 = 2;
40+
const MNG_DESIRED_CAPACITY: i32 = 0;
3741

3842
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
3943
#[serde(rename_all = "camelCase")]
@@ -227,9 +231,16 @@ struct IAMConfig {
227231
/// # Fields:
228232
/// - `name`: The name of the managed node group.
229233
#[derive(Serialize)]
234+
#[serde(rename_all = "camelCase")]
230235
struct ManagedNodeGroup {
231236
/// Name of the managed node group
232237
name: String,
238+
/// The minimum number of nodes in the managed node group.
239+
min_size: i32,
240+
/// The maximum number of nodes in the managed node group.
241+
max_size: i32,
242+
// The desired number of nodes in the managed node group.
243+
desired_capacity: i32,
233244
}
234245

235246
#[allow(clippy::unwrap_or_default)]
@@ -274,6 +285,9 @@ fn create_yaml(
274285
iam: IAMConfig { withOIDC: true },
275286
managed_node_groups: vec![ManagedNodeGroup {
276287
name: "mng-1".to_string(),
288+
min_size: MNG_MIN_SIZE,
289+
max_size: MNG_MAX_SIZE,
290+
desired_capacity: MNG_DESIRED_CAPACITY,
277291
}],
278292
};
279293

0 commit comments

Comments
 (0)