ancient-thailand-47587
12/04/2024, 8:56 PMboto3>=1.17.0,<2.0.0
pulumi==3.136.1
pulumi_aws==6.59.1
pulumi_aws_tags==0.9.0
pulumi_eks==3.3.0
I’m trying to create a eks cluster with managed node group but I’m getting the following error at runtime
Exception: A managed node group cannot be created without first setting its role in the cluster's instanceRoles
In my call to eks.ManagedNodeGroupArgs I’m passing node_role_arn=my-role-arn
already, and I’m creating the ManagedNodeGroupArgs after I create the cluster. In my call to eks.ClusterArgs, I’m already passing instance_roles=[my-role]
. In addition, I’ve added depends_on=[my-cluster, my-role]
into my call to ManagedNodeGroup.
What am I missing?modern-zebra-45309
12/04/2024, 10:53 PMnode_role=my_cluster.instanceRoles[0]
(or my_cluster.instanceRole
if you specify instanceRole
on the cluster) to the managed node group?
You can see what exactly the check is that's failing: https://github.com/pulumi/pulumi-eks/blob/master/nodejs/eks/nodegroup.ts#L2043 At first glance, it seems like the error message might be slightly misleading, because the check is a bit more involved than checking whether the role has been added to the cluster resource.
If that doesn't helo you resolve your problem, please show a complete, minimal code example that reproduces your problem so that others can check and run it.future-hairdresser-70637
12/05/2024, 1:57 AMmodern-zebra-45309
12/05/2024, 2:37 PMmodern-zebra-45309
12/05/2024, 2:38 PMmodern-zebra-45309
12/05/2024, 2:40 PMcolossal-rose-51845
12/05/2024, 2:41 PMancient-thailand-47587
12/06/2024, 3:50 PMmodern-zebra-45309
12/06/2024, 3:55 PMmycluster.core.instanceRoles
and/or mycluster.core.instanceRoles.apply(lambda role: role.arn)
as stack outputs, that's probably the easiest way.modern-zebra-45309
12/06/2024, 4:02 PMancient-thailand-47587
12/06/2024, 6:30 PMcluster.core.instance_roles
to see what it looks like.
In our actual code with business logic, I’m doing what looks to be the same thing as described above, but the managed node group does not get created due to the mentioned error,
Exception: A managed node group cannot be created without first setting its role in the cluster's instanceRoles
I also exported cluster.core.instance_roles
and the two match.
sad pandamodern-zebra-45309
12/06/2024, 6:32 PMmodern-zebra-45309
12/06/2024, 6:34 PMnodegroupRole
is truthy.
This is self-contained as far as I can see and you should easily be able to translate it to Python:
const nodegroupRole = pulumi.all([core.instanceRoles, roleArn]).apply(([roles, rArn]) => {
// Map out the ARNs of all of the instanceRoles. Note that the roles array may be undefined if
// unspecified by the Pulumi program.
const roleArns: pulumi.Output<string>[] = roles ? roles.map((role) => role.arn) : [];
// Try finding the nodeRole in the ARNs array.
return pulumi.all([roleArns, rArn]).apply(([arns, arn]) => {
return arns.find((a) => a === arn);
});
});
ancient-thailand-47587
12/06/2024, 6:35 PMcluster.access_config.authentication_mode
? Sorry I’m not too familiar with typescript/javascriptmodern-zebra-45309
12/06/2024, 6:36 PMmodern-zebra-45309
12/06/2024, 6:37 PMcore.cluster.accessConfig.authenticationMode
(you already mentioned the Python variant) and look at itancient-thailand-47587
12/06/2024, 6:37 PMmodern-zebra-45309
12/06/2024, 6:39 PMancient-thailand-47587
12/06/2024, 6:40 PMancient-thailand-47587
12/10/2024, 4:46 PMcreating EKS Node Group (...): operation error EKS: CreateNodegroup, https response error StatusCode: 400...InvalidRequestException: You do not have access to a default security group in VPC ... Specify a security group, and try again.
How do I search for the error to debug. I tried searching for “Specify a security group, and try again.” or “You do not have access to a default security group” in pulumi_eks and pulumi_aws and it returned 0 hits in code.modern-zebra-45309
12/10/2024, 6:13 PMancient-thailand-47587
12/10/2024, 6:19 PM