Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Summary
This implementation integrates the EKS Access Entries API with eksctl by using the new API to manage access for self-managed nodegroups and IAM identity mappings.
Proposal
Managing self-managed nodegroups
Creating nodegroups
eksctl will take one of two actions depending on whether the Access Entry API is enabled or not.
Access Entry API is enabled
For authorizing self-managed nodegroups, eksctl will create a unique access entry for each nodegroup with the principal ARN set to the node role ARN, and the type set to
EC2_LINUX
for Linux-based nodegroups andEC2_WINDOWS
for Windows nodegroups. A new resourceAWS::EKS::AccessEntry
will be added to a self-managed nodegroup's CloudFormation stack to allow the nodes to join the cluster. Including theAccessEntry
resource in a nodegroup's CloudFormation stack allowseksctl create nodegroup
to provide atomicity by offloading atomicity guarantees to CloudFormation. The existing codepath that adds a self-managed nodegroup’s node role ARN toaws-auth
will be removed. Thus, all new nodegroups, including on existing clusters, will use the new Access Entry API for node authorization.Access Entry API is not enabled
eksctl will continue to use the existing codepath of adding entries to the
aws-auth
ConfigMap.Deleting nodegroups
When a self-managed nodegroup is being deleted, the
AccessEntry
resource included in the nodegroup's CloudFormation stack will also be deleted. An entry for the nodegroup may exist in theaws-auth
ConfigMap if it was created when the Access Entry API was not enabled, so eksctl will inspect the nodegroup's CloudFormation stack to determine if it was authorized using the Access Entries API, and use the existing implementation of deleting the entry fromaws-auth
if it wasn't. Thus, eksctl will have to keep the existingaws-auth
-based codepath for deleting nodegroups.Managing access entries for IAM entities
Adding a top-level
accessConfig.accessEntries
fieldeksctl can add a new top-level
accessConfig.accessEntries
field that maps one-to-one to the Access Entries API.This is quite straightforward to implement as each access entry in
accessEntries
maps to theCreateAccessEntry
andAssociateAccessPolicy
APIs.If the authentication mode for the cluster is
CONFIG_MAP
, eksctl will fail early and print a message suggesting the user to enable the Access Entry APIs.Caveats
This feature maps one-to-one to the AWS API, and in that sense, eksctl does not provide any improved user experience over the AWS CLI and will act merely as a wrapper over the AWS API. Many existing users may not discover this new feature and are less likely to use it over the existing
aws-auth
-basediamIdentityMappings
feature. eksctl can improve discovery of the feature by printing a message informing the user to switch toeksctl create accessentries
wheneksctl create iamidentitymapping
is used, but this will still have less feature adoption than using the existingiamIdentityMappings
field for managing access entries.Enabling Access Entry API
eksctl will introduce a new field
accessConfig.authenticationMode
that can be set to one ofCONFIG_MAP
,API_AND_CONFIG_MAP
andAPI
.During cluster creation
If
accessConfig.authenticationMode
is set during cluster creation, eksctl will pass it to the CreateCluster API call.Existing cluster
eksctl will introduce a new command
eksctl utils update-authentication-mode --authentication-mode=CONFIG_MAP|API_AND_CONFIG_MAP|API
that updates the authentication mode for a cluster. The authentication mode can also be updated by passing a config file, as in:Disabling cluster creator admin permissions
eksctl will add a new field
accessConfig.bootstrapClusterCreatorAdminPermissions: boolean
that, when set to false, disables granting cluster-admin permissions to the IAM identity creating the cluster. When this field is set to false, eksctl will pass its value toBootstrapClusterCreatorAdminPermissions
.Checklist
README.md
, or theuserdocs
directory)area/nodegroup
) and kind (e.g.kind/improvement
)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯