https://pulumi.com logo
Title
b

bulky-painting-12886

11/19/2021, 9:59 AM
follows the code snippet with the node definition that I used:
from pulumi import ResourceOptions
from pulumi_aws import eks

cluster = eks.Cluster("cluster-dev",
                       role_arn=cluster_role.arn,
                       vpc_config=cluster_vpc_config,
                       version="1.20",
                       tags={"Name": "cluster-dev"},
                       opts=ResourceOptions(depends_on=cluster_subnets))

eks.NodeGroup("my-node",
              capacity_type="SPOT",
              cluster_name=cluster.name,
              node_role_arn=node_role.arn,
              subnet_ids=[public_subnet_a.id,
                          public_subnet_b.id],
              scaling_config=eks.NodeGroupScalingConfigArgs(
                  desired_size=2,
                  max_size=4,
                  min_size=2),
              tags={"Name": "my-node"},
              opts=ResourceOptions(parent=cluster))
a

agreeable-ram-97887

11/19/2021, 4:58 PM
not a pulumi- or AWS-dev here, so take this with a grain of salt. But, I image that the nodegroup doesn’t provision nodes across subnets in a round-robin type style (which is what it seems like you’re assuming it does). Rather I bet it’s more like “first-come-first-serve’ So, if you want to ensure that they there are always nodes in different subnets, you could just use two different NodeGroups, which each have access to only one subnet
👍 1