Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for Karpenter v1 controller IAM role permissions #3126

Conversation

andy-townsend
Copy link
Contributor

@andy-townsend andy-townsend commented Aug 15, 2024

Description

This PR updates the IAM role for the Karpenter Controller to reflect all the changes made for Karpenter v1.0.0

Motivation and Context

Without this, karpenter fails to start nodes when upgraded to v1.0.0. Solves errors such as;

"error":"tagging nodeclaim, tagging instance, UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::12345678990:assumed-role/karpenter-controller-lab/1723721642521363579 is not authorized to perform: ec2:CreateTags on resource: arn:aws:ec2:eu-west-1:12345678990:instance/i-0d25b72e6a588fa4b because no identity-based policy allows the ec2:CreateTags action. 

They removed the sqs:GetQueueAttributes in this change

This change shows all the changes in the controller IAM policy (taken from website/content/en/docs/getting-started/getting-started-with-karpenter/cloudformation.yaml)

Breaking Changes

  • No

How Has This Been Tested?

Tested in my lab setup, changes applied and nodes now spin up.

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@andy-townsend andy-townsend changed the title chore: update controller IAM role permissions to support karpenter v1 chore: Update controller IAM role permissions to support karpenter v1 Aug 15, 2024
versions.tf Outdated Show resolved Hide resolved
@bryantbiggs
Copy link
Member

I will need to check if this is backwards compatible with Karpenter versions < 1.0 before we can proceed

This reverts commit f0e5c79.
@suraj2410
Copy link

any plans when this would be merged and available for hee?

@senilio
Copy link

senilio commented Aug 19, 2024

I quickly tried this PR with Karpenter 0.37.0, and I found an issue with launching new nodes.

{"level":"ERROR","time":"2024-08-19T05:33:46.765Z","logger":"controller","message":"Reconciler error","commit":"490ef94","controller":"nodeclaim.lifecycle","controllerGroup":"karpenter.sh","controllerKind":"NodeClaim","NodeClaim":{"name":"default-std9a"},"namespace":"","name":"default-std9a","reconcileID":"b6913acf-0fb6-417b-b206-38e3b2bb813f","error":"launching nodeclaim, creating instance, getting launch template configs, getting launch templates, creating launch template, UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::1234567890:assumed-role/KarpenterController-20240816080453288700000001/1724044805759067430 is not authorized to perform: ec2:CreateLaunchTemplate on resource: arn:aws:ec2:eu-west-1:1234567890:launch-template/* because no identity-based policy allows the ec2:CreateLaunchTemplate action.

Likely due to the additions of aws:RequestTag/eks:eks-cluster-name

@bryantbiggs bryantbiggs changed the title chore: Update controller IAM role permissions to support karpenter v1 feat: Add support for Karpenter v1 controller IAM role permissions Aug 19, 2024
@bryantbiggs bryantbiggs merged commit e317651 into terraform-aws-modules:master Aug 19, 2024
21 checks passed
antonbabenko pushed a commit that referenced this pull request Aug 19, 2024
## [20.24.0](v20.23.0...v20.24.0) (2024-08-19)

### Features

* Add support for Karpenter v1 controller IAM role permissions ([#3126](#3126)) ([e317651](e317651))
@antonbabenko
Copy link
Member

This PR is included in version 20.24.0 🎉

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Karpenter] upgrade to v.1.0
6 participants