Skip to content

fix(cfn): preserve path in managed nodegroup instanceRoleARN - #8874

Open
Cozm1n1412 wants to merge 1 commit into
eksctl-io:mainfrom
Cozm1n1412:fix/preserve-pathed-instance-role-arn
Open

Cozm1n1412 wants to merge 1 commit into
eksctl-io:mainfrom
Cozm1n1412:fix/preserve-pathed-instance-role-arn

Conversation

@Cozm1n1412

Copy link
Copy Markdown

Description

Fixes #7846

When specifying a pathed IAM role in managedNodeGroups[*].iam.instanceRoleARN (e.g. arn:aws:iam::123456789012:role/team/custom-node-role), pkg/cfn/builder/managed_nodegroup.go was invoking NormalizeARN(), stripping the path from the role ARN passed to the CloudFormation AWS::EKS::Nodegroup resource's NodeRole property.

While NormalizeARN was historically introduced as a compatibility workaround for the aws-auth ConfigMap / aws-iam-authenticator (which failed to match pathed ARNs), CloudFormation and the EKS control plane require the exact, canonical IAM role ARN. On EKS 1.29+ clusters utilizing the native Access Entries API, this path truncation causes managed node groups to enter a Degraded status with the error access entry not found in cluster.

Changes

  • Removed NormalizeARN call on m.nodeGroup.IAM.InstanceRoleARN when constructing the NodeRole CloudFormation property in pkg/cfn/builder/managed_nodegroup.go.
  • Updated test case in pkg/cfn/builder/managed_nodegroup_test.go (TestManagedNodeRole) to verify that the instance role ARN retains its full path.

Verification

Executed test suite:

go test -v ./pkg/cfn/builder -run TestManagedNodeRole
go test ./pkg/cfn/builder/...

All tests pass.

Previously, NormalizeARN stripped the path prefix from instanceRoleARN
when generating the CloudFormation NodeRole property for managed nodegroups.
While originally intended for aws-auth ConfigMap compatibility, this causes
managed nodegroups to enter a Degraded state on EKS clusters using Access
Entries, as the truncated ARN does not match the actual IAM role.

Fixes eksctl-io#7846

Signed-off-by: Cosmin Neculcea <cosminneculcea60@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Hello Cozm1n1412 👋 Thank you for opening a Pull Request in eksctl project. The team will review the Pull Request and aim to respond within 1-10 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Degraded managedNodeGroups when using a pathed instanceRoleARN

1 participant