-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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(eks): support AccessConfig for the Cluster construct #30016
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Co-authored-by: GZ <hz351086153@gmail.com>
@pahud is there anything that can be done to encourage getting this merged in? We really need it in our project to be able to setup eks clusters properly in one phase. |
Thank you @richardgroves I appreciate your concern. I will make another iteration this week and get the CDK team and EKS team review again. Hopefully to clarify some details and move it forward. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Background
Amazon EKS originally uses
ConfigMap
as its access management and in aws-eks we use AwsAuth to leverage the kubectl from kubectl-lambda-layer to create the AwsAuth configmap for that. The ConfigMap has been very difficult to maintain due to its lack support of EKS API but thanks to the AwsAuth class, it's been very smooth in CDK.In AWS reInvent 2023 we announced the access API support that simplifies the management as a replacement of the traditional ConfigMap. In CloudFormation we have the AccessConfig with AuthenticationMode and
BootstrapClusterCreatorAdminPermissions
now.The
AuthenticationMode
supportsAPI_AND_CONFIG_MAP
, which is the default,API
andCONFIG_MAP
. It allows users to switch the mode on cluster creation or update. When the mode has API support, users have to define theAccessEntry
to map the access policies and the IAM principals. This PR introduces theAccessEntry
andAccessPolicy
classes for that to simplify it with similar experience just as the iam.ManagedPolicy class. This PR also introduces thegrantAccess()
method that allows a cluster togrant
its access to a specific principal and abstracts away the complexity.Overview of the API experience from this PR:
Issue # (if applicable)
Closes #28588
This PR introduces the
authenticationMode
,AccessEntry
andAccessPolicy
for bothCluster
andFargateCluster
construct.@aws-sdk/client-eks
to v3.476.0(the minimal version with EKS Cluster Access Management support)Notes
undefined(CONFIG_MAP) -> API_AND_CONFIG_MAP -> API
You can switch from undefined or CONFIG_MAP to API_AND_CONFIG_MAP. You can then switch from API_AND_CONFIG_MAP to API. You cannot revert these operations in the opposite direction. Meaning you cannot switch back to CONFIG_MAP or API_AND_CONFIG_MAP from API. And you cannot switch back to CONFIG_MAP from API_AND_CONFIG_MAP. (see here) This PR adds relevant checks in the custom resource and add docstring in the
authenticationMode
prop.bootstrapClusterCreatorAdminPermissions
would cause cluster replacement, we callout in the README and construct prop docstring as a headsup. This option is available in CFN which triggers replacement on resource update as well. I have created eks: ack prop for potential cluster replacement #30107 for further improvement.Reason for this change
Description of changes
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license