-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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] - CDK support for Custom AMI Support for EKS Managed Nodes feature #9873
Comments
I am the original contributor of the managed nodegroup. I'll try extend it with the custom AMI support with a new PR. |
…ort (#9881) - This PR allows you to: 1. use `LaunchTemplate` for the managed nodegroups 2. specify custom AMI in the `LaunchTemplate` - `prop.vpc` of Pinger is now `ec2.IVpc` - bump cluster k8s version in the integration testing from `1.16` to `1.17` Closes: #9873 Closes: #9924 ## Note At this moment we use the property override to make it work. When cfn spec is updated we can use `CfnNodeGroup` to specify launch template natively, which should be backward-compatible with no breaking changes. Users will need to create `CfnLaunchTemplate` resource and pass the resource as the property to the nodegroup untill we support the LaunchTemplate L2(#6734). ## TODO - [x] integ testing - [x] unit testing - [x] update README ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Reading these comments, it seems to me that there currently is a possibility to use CDK for creating nodes with custom AMI. Can someone please explain how to do this? |
Hi Eli, thank you very much for the response. I am writing my code in
Python, and when I try to translate the code you referenced to python it
doesn't seem to work.
Any chance you have that same code in Python that I can use as a reference?
Thanks a lot,
Boaz
…On Sun, Jun 20, 2021 at 5:16 PM Eli Polonsky ***@***.***> wrote:
@boazsilverman <https://github.com/boazsilverman>
https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-eks#launch-template-support
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9873 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARGHOTNTUV2E7TKLX3G5MOLTTXZ4FANCNFSM4QGCSJ6Q>
.
|
Hey, when trying to apply exactly the same logic, just in Python, here is
the result I got:
[image: image.png]
My code is attached:
ssh_connection = aws_eks.NodegroupRemoteAccess(
ssh_key_name="cdk-pair-ohio",
source_security_groups=[cluster.cluster_security_group]
)
user_data = aws_ec2.UserData.custom(
'/aws/service/eks/optimized-ami/1.16/amazon-linux-2/recommended/image_id')
user_data.add_commands("set -o xtrace", f"/etc/eks/bootstrap.sh {
cluster.cluster_name}")
ltd = aws_ec2.CfnLaunchTemplate.LaunchTemplateDataProperty(
image_id="ami-0ebe2603fe80091fd",
instance_type="t3.small",
user_data=core.Fn.base64(user_data.render()),
)
lt = aws_ec2.CfnLaunchTemplate(scope=self, id="LaunchTemplate",
launch_template_data=ltd
)
lts = aws_eks.LaunchTemplateSpec(id=lt.ref)
group = aws_eks.Nodegroup(
scope=self,
id=f'{id}-nodegroup',
cluster=cluster,
nodegroup_name=f'{id}-nodegroup',
remote_access=ssh_connection,
launch_template_spec=lts,
min_size=2,
max_size=100,
)
Any chance you understand the problem, and can explain to me how to solve
it?
Thanks,
Boaz
On Mon, Jun 21, 2021 at 8:22 AM Boaz Silverman ***@***.***>
wrote:
… Hi Eli, thank you very much for the response. I am writing my code in
Python, and when I try to translate the code you referenced to python it
doesn't seem to work.
Any chance you have that same code in Python that I can use as a reference?
Thanks a lot,
Boaz
On Sun, Jun 20, 2021 at 5:16 PM Eli Polonsky ***@***.***>
wrote:
> @boazsilverman <https://github.com/boazsilverman>
> https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-eks#launch-template-support
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#9873 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ARGHOTNTUV2E7TKLX3G5MOLTTXZ4FANCNFSM4QGCSJ6Q>
> .
>
|
Looks like the image didn't upload. If you feel you are encountering a bug, please open a separate issue with the reproduction and the error message. |
Hi, I need to define userdata for nodegroups with cdk. It is possible to perform that action without having to work with a custom ami. |
Amazon Elastic Kubernetes Service (EKS) now supports EC2 Launch Templates and custom AMIs for managed node groups. When combined, these new features provide flexible configuration and customization options for Amazon EC2 instances which are managed as Kubernetes nodes by EKS. This enables you to leverage the simplicity of managed node provisioning and lifecycle management features while adhering to any level of customization, compliance, or security requirements.
https://aws.amazon.com/blogs/containers/introducing-launch-template-and-custom-ami-support-in-amazon-eks-managed-node-groups/
Use Case
Customers who needs Custom AMI to clear the blocker to adopt the EKS Managed Node Group solution, is now available to use the new feature provided from the EKS Managed Node Group.
However, the CDK currently yet to support the feature.
Proposed Solution
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: