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

eks: Remove the Cluster custom resource in favour of L1 #28609

Closed
1 of 2 tasks
gricey432 opened this issue Jan 8, 2024 · 4 comments
Closed
1 of 2 tasks

eks: Remove the Cluster custom resource in favour of L1 #28609

gricey432 opened this issue Jan 8, 2024 · 4 comments
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@gricey432
Copy link

gricey432 commented Jan 8, 2024

Describe the feature

Currently, eks.Cluster is implemented as a Custom Resource, though I believe this is no longer required and is causing unneeded complexity.

The docstring for the CR says

 Implements EKS create/update/delete through a CloudFormation custom resource
 in order to allow us to control the IAM role which creates the cluster. This
 is required in order to be able to allow CloudFormation to interact with the
 cluster via `kubectl` to enable Kubernetes management capabilities like apply
 manifest and IAM role/user RBAC mapping.

This was added 4 years ago in #3510 and I don't think it's true anymore. The Cfn resource takes a RoleArn property which should solve the problem identified in the docstring.

I had a quick run through of the custom handler source and it looks like it hasn't really gained any other features since then, so should be a straighforward replacement.

Use Case

#28584 highlights the serious risks introduced by CDK diverging from Cloudformation and implementing custom resources. The current implementation makes the behaviour harder to inspect.

Proposed Solution

The L2 eks.Cluster should replace its internal ClusterResource with just the L1 CfnCluster.

I'm unsure on how this migration would actually have to work.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.113.0 (build ccd534a)

Environment details (OS name and version, etc.)

N/A

@gricey432 gricey432 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2024
@github-actions github-actions bot added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Jan 8, 2024
@gshpychka
Copy link
Contributor

The Cfn resource takes a RoleArn property which should solve the problem identified in the docstring.

I don't think this is correct - that is for the role that calls AWS APIs, not kubectl.

@gricey432
Copy link
Author

I don't think this is correct - that is for the role that calls AWS APIs, not kubectl.

I think you're right. @benfriebe do you think we might have this backwards?

https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-eks/lib/cluster-resource.ts#L79 and Line 92 show where the two different roles are used for their different purposes.

Is this "creator is admin" problem supposed to be solved by Access Entries?

@pahud
Copy link
Contributor

pahud commented Jan 8, 2024

We absolutely need the new module. Let's track this feature request in #24059 and please help us prioritize with 👍 on that issue.

I am closing this one in favor of #24059

@pahud pahud closed this as completed Jan 8, 2024
Copy link

github-actions bot commented Jan 8, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants