-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Description
Observed Behavior:
Karpenter will create hundreds of "zombie" instance profiles that caused us to reach our AWS Quota and we started seeing reconciler errors
{"level":"ERROR","time":"2025-12-31T08:27:43.178Z","logger":"controller","caller":"controller/controller.go:474","message":"Reconciler error","commit":"c9c3a48","controller":"nodeclass","controllerGroup":"karpenter.k8s.aws","controllerKind":"EC2NodeClass","EC2NodeClass":{"name":"sandbox-x86"},"namespace":"","name":"sandbox-x86","reconcileID":"daa53858-4bd7-4456-848b-29345886c3de","aws-operation-name":"CreateInstanceProfile","aws-request-id":"9d5f627e-3e35-4711-9021-c9f5b │ │ e5746d7","aws-service-name":"IAM","aws-status-code":409,"instance-profile":"frstg2_4574861420783301831","error":"creating instance profile, operation error IAM: CreateInstanceProfile, https response error StatusCode: 409, RequestID: 9d5f627e-3e35-4711-9021-c9f5be5746d7, LimitExceeded: Cannot exceed quota for InstanceProfilesPerAccount: 1000 (aws-operation-name=CreateInstanceProfile, aws-request-id=9d5f627e-3e35-4711-9021-c9f5be5746d7, aws-service-name=IAM, aws-status-cod │ │ e=409) (instance-profile=frstg2_4574861420783301831)"}
We realized that we had 2 misconfigurations. First, we were accidentally applying resource filtering on our ListIamInstanceProfiles policy (which is not supported: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsidentityandaccessmanagementiam.html) that was attached to the Karpenter controller. Second, we were also using the IAM Role ARN instead of name in all of our EC2NodeClasses
Expected Behavior:
According to this (instanceprofile.go) it seems like using the ARN of the IAM Role in the EC2NodeClass shouldn't actually be supported yet we've been running Karpenter with the Role ARN for several months. It seems like the fix should either be to support the ARN or display an error when the ARN is used for the role.
Reproduction Steps (Please include YAML):
- Set the role for the EC2NodeClass to the ARN of the IAM Role instead of the name of the IAM Role.
- Do not attach the ListIamInstanceProfiles permission to the Karpenter controller
Versions:
- Chart Version: 1.8.3
- Kubernetes Version (
kubectl version): 1.33
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment