aws-samples / cdk-eks-karpenter

CDK construct for installing and configuring Karpenter on EKS clusters
Apache License 2.0
34 stars 14 forks source link

Parameterize Karpenter Node Role or create a method to update the policy of the role #110

Closed badaldavda8 closed 1 year ago

badaldavda8 commented 1 year ago

Hi team,

I am facing another issue where I need to customize my nodeRole and would like to add a custom node role or have ability to update the policy of the role.

I know that we can do this via NodeTemplate and override the settings. It would be great if we could reuse the role. Or if we override it using NodeTemplate, then we should not create the karpenterNodeRole at all.

badaldavda8 commented 1 year ago

We can customize this using karpenter -

karpenter_node_role.add_managed_policy(iam.ManagedPolicy.from_aws_managed_policy_name('AmazonEKSWorkerNodePolicy'))

But if I need to use a custom role and not make it create an extra role its not possible.

One of my clients is looking to use their own naming convention for Roles instead of the predefined naming convention