Closed jamesongithub closed 4 days ago
@jamesongithub Apologies that you're facing this. I was able to reproduce on my end. It seems like the error is coming from https://github.com/pulumi/pulumi-eks/blame/c95cf4402c8d3c1f71440c566a0b3d8caa2090b2/nodejs/eks/nodegroup.ts#L1662.
Note, I did not encounter this error when running this in a typescript pulumi program.
Hi @rquitales ,
Thanks for reproducing.
I can't tell from that stack trace.
A node role arn was passed to both node groups. Seems like that condition should pass?
thanks
@jamesongithub After looking at the repro code in more detail, it looks like you are missing declaring the node role within your cluster's instance roles.
Here is a python example which demonstrates this: https://github.com/pulumi/pulumi-eks/blob/c95cf4402c8d3c1f71440c566a0b3d8caa2090b2/examples/managed-nodegroups-py/__main__.py#L15
When updating the code you provided, I can successfully create the managed node groups:
eks_cluster = eks.Cluster("eks-cluster",
# Put the cluster in the new VPC created earlier
vpc_id=eks_vpc.vpc_id,
# Public subnets will be used for load balancers
public_subnet_ids=eks_vpc.public_subnet_ids,
# Private subnets will be used for cluster nodes
private_subnet_ids=eks_vpc.private_subnet_ids,
# Change configuration values to change any of the following settings
# Do not give worker nodes a public IP address
node_associate_public_ip_address=False,
# Change these values for a private cluster (VPN access required)
endpoint_private_access=False,
endpoint_public_access=True,
skip_default_node_group=True,
instance_roles=[node_role],
)
# ... rest of code
This is necessary because the nodegroup role needs to be set on the cluster to ensure that the aws-auth
ConfigMap contains the required entries. Alternatively, you could use the newer Access Entry auth mode instead. Please see this documentation on enabling Access Entry for EKS clusters using this provider.
I'll keep this issue open however, since we can better handle the Cannot read properties of undefined (reading 'map')
error we both observed so that a more meaningful error is presented.
Ok, thanks, Ill test it out.
It actually doesn't mention it as a prerequisite here: https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html
Might be helpful to have a check on eks_cluster like there is on the managed_node_groups like you had referenced if it's a required attribute. (I'm unclear if it's needed only if you use managed node groups or not)
@rquitales I added just the node role only and it did not work.
i had to change this reference from eks_cluster.core
to eks_cluster
managed_node_group_infra = eks.ManagedNodeGroup("infra",
...
cluster=eks_cluster.core,
node_group_name="infra-nodes",
...
managed_node_group_infra = eks.ManagedNodeGroup("infra",
...
cluster=eks_cluster,
node_group_name="infra-nodes",
...
both changes, the node role in eks_cluster and this eks_cluster reference was required to deploy successfully
Thanks for the updates and further investigation - I'll look into why cluster.core
isn't working. Glad you've managed to get unblocked though.
What happened?
trying to create eks cluster with 2 managed node groups
Example
Output of
pulumi about
Additional context
stack trace
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).