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

Update aws-auth ConfigMap in clusters created outside of CDK #19753

Open
2 tasks
jicowan opened this issue Apr 4, 2022 · 4 comments
Open
2 tasks

Update aws-auth ConfigMap in clusters created outside of CDK #19753

jicowan opened this issue Apr 4, 2022 · 4 comments
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service @aws-cdk/aws-iam Related to AWS Identity and Access Management feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature/service-integration Add functionality to an L2 construct to enable easier integration with another service feature-request A feature should be added or improved. p2

Comments

@jicowan
Copy link

jicowan commented Apr 4, 2022

Describe the feature

Add the ability to "import" existing EKS clusters that were created outside of CDK/CloudFormation so that you can use the AddRoleMapping method to update the aws-auth ConfigMap

Use Case

I have inadvertently corrupted the aws-auth ConfigMap when updating it manually. When this happens, I lose access to the cluster and have to manage it using the IAM user/role that was used to provision the cluster. I would like to be able to use the CDK to consistently and correctly apply changes to the ConfigMap.

Proposed Solution

The following should work:

cluster = eks.Cluster.from_cluster_attributes(self, "Cluster", cluster_name="MyEKSCluster") <-- existing cluster
role = iam.Role.from_role_arn(self, "Role", "arn:aws:iam::123456789012:role/my_role") <-- existing role
eks.AwsAuth(self, "Auth", cluster=cluster).add_role_mapping(role=role, groups="system:masters") <-- add role mapping

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.19.0

Environment details (OS name and version, etc.)

MacOS Monterey 12.2.1

@jicowan jicowan added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 4, 2022
@github-actions github-actions bot added the @aws-cdk/aws-iam Related to AWS Identity and Access Management label Apr 4, 2022
@jicowan
Copy link
Author

jicowan commented Apr 4, 2022

The function would need to be authorized to update the aws-auth ConfigMap. If you import an existing cluster, you should be allowed to pass in the role you want the function to assume or run as the current logged in user.

@rix0rrr rix0rrr assigned iliapolo and unassigned rix0rrr Apr 7, 2022
@sdpoueme
Copy link

sdpoueme commented Jun 8, 2022

This is definitely a useful feature. We are building an end-to-end ci/cd pipeline for containerized game servers and facing that issue at the moment.

@indrora indrora added p1 feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature/service-integration Add functionality to an L2 construct to enable easier integration with another service @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service and removed needs-triage This issue or PR still needs to be triaged. labels Jun 9, 2022
@srinivasreddych
Copy link

This is a needed feature for us. We are building a shared compute capacity on EKS, where we would like to run Batch Jobs, Spark jobs etc, and everytime we onboard a new use-case specific module, adding the Role/user to the aws-auth CM on an imported cluster is causing us trouble. For now, we are using eksctl to establish the identity mapping and resuming other CDK processes.

@iliapolo iliapolo removed their assignment May 16, 2023
@iliapolo
Copy link
Contributor

iliapolo commented May 16, 2023

This issue has been re-classified as p2. That means a workaround is available or it is deemed a nice-to-have feature. Given the amount of work there is to do and the relative priority of this issue, the CDK team is unlikely to address it. That does not mean the issue will never be fixed! If someone from the community submits a PR to fix this issue, and the PR is small and straightforward enough, and meets the quality bars to be reviewed and merged with little effort we will accept that PR. PRs that do not build or need complex or multiple rounds of reviews are unlikely to be merged and will be closed to keep our backlog manageable.

We use +1s on this issue to help prioritize our work, and are happy to re-evaluate the prioritization of this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization.

@iliapolo iliapolo added p2 and removed p1 labels May 16, 2023
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 @aws-cdk/aws-iam Related to AWS Identity and Access Management feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature/service-integration Add functionality to an L2 construct to enable easier integration with another service feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

6 participants