Skip to content

Nodegroup

Source: src/AWS/EKS/Nodegroup.ts

An Amazon EKS managed node group — an EC2 Auto Scaling group of worker nodes managed by EKS for a cluster.

Managed node groups provide the compute capacity a non-Auto-Mode EKS cluster needs to run pods. Creation is asynchronous (CREATINGACTIVE, ~2–5 min) and the provider waits for the group to become ACTIVE before returning. Scaling, labels, taints, update config, and version are mutable in place; subnets, instance types, AMI type, disk size, node role, capacity type, and remote access are immutable and force a replacement.

Managed Node Group

const nodes = yield* Nodegroup("AppNodes", {
clusterName: cluster.clusterName,
nodeRole: nodeRole.roleArn,
subnets: network.privateSubnetIds,
instanceTypes: ["t3.medium"],
scalingConfig: { minSize: 1, maxSize: 3, desiredSize: 2 },
});

Spot Node Group with Labels and Taints

const spot = yield* Nodegroup("SpotNodes", {
clusterName: cluster.clusterName,
nodeRole: nodeRole.roleArn,
subnets: network.privateSubnetIds,
capacityType: "SPOT",
instanceTypes: ["t3.large", "t3a.large"],
scalingConfig: { minSize: 0, maxSize: 5, desiredSize: 1 },
labels: { workload: "batch" },
taints: [{ key: "spot", value: "true", effect: "NO_SCHEDULE" }],
});