keikoproj/instance-manager

Remove AmazonEKS_CNI_Policy from DefaultManagedPolicies

backjo opened this issue · 2 comments

AmazonEKS_CNI_Policy is currently part of DefaultManagedPolicies, which are automatically added to the roles created and associated with nodes provisioned by the EKS provisioner.

In the AWS docs, it is recommended to remove it and use IAM Roles for Service Accounts instead.
We should remove it from the defaults or offer a way for users to opt-out of attaching it.

We will need to keep involvement here minimal, but can allow control to adding policy to controller-owned role by using an annotation like instancemgr.keikoproj.io/use-irsa="true"

  • if annotation is true, and role is owned by controller, don't add AmazonEKS_CNI_Policy to role / remove it.
  • this is only relevant if IAM role is owned by the controller - if you bring our own role (by providing roleName / instanceProfileName - there will be no effect and you are responsible 100% for migrating to IRSA, as well as burden of configuring OIDC correctly should be on the user, controller should not try to configure OIDC for the user.

Possible Migration Path for using controller-owned roles

WDYT?

Yep, that seems to be along the same lines of what I was thinking. A new annotation seems like the cleanest way.