-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[aws-eks] eks.Cluster.fromAttributes: Allow adding k8s resources on imported clusters #5383
Comments
I am trying to achieve the same. Now I am sharing my eks cluster around stack code so I can call addResource from different stacks. However it seems like it all ends up in the same stack by doing this. What's the best way of achieving this for now? |
Can you guys please describe your use case? What are you trying to achieve by doing this? |
Well, for us, we created our EKS cluster using cloudformation before eksctl was a thing. Eksctl is pretty worthless to us because unless you start with it, you can never use it thereafter. It would be nice to be able to import a cluster in CDK and add autoscaling groups, for example, and have their roles automatically added to the cluster so that can just join, like it does today starting with the CDK. |
Unfortunately I think it may be quite challenging to support this capability. I am wondering, is there a way to make it easier for you to recreate the EKS cluster through the CDK? |
Yeah, I've thought about recreating the cluster, it would just require some careful planning. |
It's a great feature to help customer operate everything through CDK. |
In my case we have multiple repositories and each of them creates different part of infrastructure using CDK. Some repo needs to create an eks fargate profile o apply some manifest through addResource method to a same cluster. Is there any workarround for this since we can't import the cluster for every repo and use this kind of methods? (creating a cluster for every repo would be over dimensioned). |
Any workarround for this until a final implementation? |
Another problem we have find out related to this issue is that using addResource method from different stacks in the same app (passing the cluster as argument to the stack that calls addResource) the cloudformation resource is actually created on the stack where the EKS Cluster was created instead of the stack where the addResource was called. This wouldn't be a problem itself if Cloudfromation didn't have the 200 resource limit per stack. |
Allow adding Kubernetes resources such as manifests and Helm charts to imported clusters (`eks.Cluster.fromAttributes`). To enable this behavior, when the cluster is imported, users will have to specify additional information: - `kubectlRole` - an IAM role that can issue kubectl commands against the cluster - `kubectlEnvironment` (optional) - environment variables for `kubectl`. - `kubectlPrivateSubnets` and `kubectlSecurityGroup` - required if the cluster's k8s endpoint is private Resolves #5383
Another purpose of having a fully capable |
Allow adding Kubernetes resources such as manifests and Helm charts to imported clusters (`eks.Cluster.fromAttributes`). To enable this behavior, when the cluster is imported, users will have to specify additional information: - `kubectlRole` - an IAM role that can issue kubectl commands against the cluster - `kubectlEnvironment` (optional) - environment variables for `kubectl`. - `kubectlPrivateSubnets` and `kubectlSecurityGroup` - required if the cluster's k8s endpoint is private Resolves #5383 BREAKING CHANGE: when importing EKS clusters using `eks.Cluster.fromClusterAttributes`, the `clusterArn` attribute is not supported anymore, and will always be derived from `clusterName`. * **eks**: Only a single `eks.Cluster` is allowed per CloudFormation stack. * **eks**: The `securityGroups` attribute of `ClusterAttributes` is now `securityGroupIds`. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Currently I have an existing EKS cluster, is that possible to call
addResource
from another pipeline or someplace?Use Case
I tried to use fromClusterAttributes, but it only returns a ImportedCluster which does not have any static method.
It will be good to have:
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: