✨ Add ExistingLaunchTemplate (BYO) support for EKS managed node groups#5906
✨ Add ExistingLaunchTemplate (BYO) support for EKS managed node groups#5906AmitSahastra wants to merge 3 commits intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @AmitSahastra. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
962cb7e to
ec3d921
Compare
ec3d921 to
10b2118
Compare
10b2118 to
02021ae
Compare
|
Hi @fiunchinho @serngawy the bot suggested I consider joining the kubernetes-sigs org given my contributions. Would either of you be willing to sponsor me for membership? I'm happy to open the formal request at https://github.com/kubernetes/org/issues/new?template=membership.md once I have two sponsors confirmed. Thanks! |
d6487c5 to
b292a1b
Compare
Allow users to reference a pre-existing (BYO) AWS EC2 launch template by ID in AWSManagedMachinePoolSpec.AWSLaunchTemplate, instead of having CAPA create and manage one. When AWSLaunchTemplate.ID is set: - CAPA uses the referenced template directly and will not create, update, or delete it - versionNumber is required; CAPA-managed fields (ami, instanceType, sshKeyName, rootVolume, etc.) are forbidden - ID and Name are immutable after creation; versionNumber is mutable to support rolling out new template versions without replacing the nodegroup Key changes: - New ID field on exp/api/v1beta2.AWSLaunchTemplate with CEL immutability rule; v1beta1 is NOT modified (field is v1beta2-only per deprecation policy); ID survives v1beta2→v1beta1→v1beta2 round-trips via the CAPI MarshalData/UnmarshalData annotation mechanism, restored in ConvertTo for both AWSManagedMachinePool and AWSMachinePool - Generated files (CRDs, deepcopy, conversion) produced by make generate; v1beta1 CRD schema has no id field or XValidation rules - IsBYOLaunchTemplate() scope helper gates controller and nodegroup service to skip LT create/delete lifecycle for BYO templates - Webhook validates BYO-specific invariants and immutability - launchTemplateNeedsUpdate() helper covers ID changes and concrete version changes while skipping symbolic aliases ($Latest, $Default) to prevent endless reconcile loops - Guard against nil Version/ReleaseVersion on CREATE_FAILED/DELETE_FAILED nodegroups - LaunchTemplateNeedsUpdate returns a reason enum for improved log output - e2e test (BYOMachinePoolSpec): creates a real EC2 launch template, creates the nodegroup, and verifies the nodegroup uses the BYO template ID Signed-off-by: Amit Sahastrabuddhe <amit.sahastra@gmail.com>
459ba3d to
07c03fa
Compare
|
/ok-to-test |
|
/retest |
What this PR does
Adds a new
existingLaunchTemplatefield toAWSManagedMachinePoolSpecthat allows users to reference a pre-existing (BYO) AWS launch template by ID or name for EKS managed node groups, instead of having CAPA create and manage one.This enables use cases where organizations manage launch templates externally (e.g. via Terraform, CloudFormation, or the AWS console) and want CAPA to use them as-is.
Fixes #5896
Key changes
API (v1beta1 + v1beta2):
ExistingLaunchTemplateReftype withid,name, andversionfieldsexistingLaunchTemplatefield onAWSManagedMachinePoolSpec, mutually exclusive withawsLaunchTemplateController:
Webhook validation:
existingLaunchTemplateandawsLaunchTemplateidornameversionidandnameare immutable;versionis intentionally mutable (to allow rolling out new LT versions)diskSizeandinstanceTypeare rejected when any launch template is specifiedNodegroup service:
CreateNodegroupandUpdateNodegroupVersion$Latest,$Default) to avoid endless reconcile loopsVersion/ReleaseVersionon failed nodegroupsTests:
isSymbolicLaunchTemplateVersionhelperHow to test
AWSManagedMachinePoolspec:Release note: