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

generic-cluster-provider.ts: specifying a launchTemplate in ManagedNodeGroup causes amiType and amiReleaseVersion to be ignored/discarded #768

Closed
OK-Apps opened this issue Jul 11, 2023 · 0 comments · Fixed by #770
Assignees
Labels
bug Something isn't working

Comments

@OK-Apps
Copy link

OK-Apps commented Jul 11, 2023

Describe the bug

when specifying a launchTemplate in ManagedNodeGroup properties - it causes the specified amiType and amiReleaseVersion to be ignored/discarded -
i.e. the AmiType and ReleaseVersion disappear from the CloudFormation template that is being generated

Expected Behavior

adding a launchTemplate to ManagedNodeGroup properties does not cause ignoring/discarding amiType and amiReleaseVersion properies - i.e. respective AmiType and ReleaseVersion CloudFormaton properties are not disappearing from the CloudFormation template that is being generated

Current Behavior

when specifying a launchTemplate in ManagedNodeGroup properties - it causes the specifiedamiType and amiReleaseVersion to be ignored/discarded -
i.e. the AmiType and ReleaseVersion disappear from the CloudFormation template that is being generated

Reproduction Steps

Step 1.
first generate (synth) with using ManagedNodeGroup without launchTemplate and see that CloudFormation template contains AmiType and ReleaseVersion with correct values (as specified by amiType and amiReleaseVersion props)

const managedNodegroup1:blueprints.ManagedNodeGroup = {
  id: idForManagedNodegroup1,
  amiType: eks.NodegroupAmiType.AL2_X86_64,
  amiReleaseVersion: amiReleaseVersion,         
  instanceTypes: [new ec2.InstanceType(instanceType)], 
  nodeGroupCapacityType: eks.CapacityType.ON_DEMAND,  
  desiredSize: nodegroupDesiredSize,
  minSize: nodegroupMinSize,
  maxSize: nodegroupMaxSize, 
  nodeGroupSubnets: vpcSubnetsSubsetSelected,
  nodeRole: iamRoleForEksNodegroupWorkerNodes, 
};

Step 2.
now,
add a launchTemplate as well and synth again and see that AmiType and ReleaseVersion completely disappeared from the CloudFormation template:

const managedNodegroup1:blueprints.ManagedNodeGroup = {
  id: idForManagedNodegroup1,
  amiType: eks.NodegroupAmiType.AL2_X86_64,
  amiReleaseVersion: amiReleaseVersion,         
  instanceTypes: [new ec2.InstanceType(instanceType)], 
  nodeGroupCapacityType: eks.CapacityType.ON_DEMAND,  
  desiredSize: nodegroupDesiredSize,
  minSize: nodegroupMinSize,
  maxSize: nodegroupMaxSize, 
  nodeGroupSubnets: vpcSubnetsSubsetSelected,
  nodeRole: iamRoleForEksNodegroupWorkerNodes,
  launchTemplate: {
       // "You can pass Custom Tags to Launch Templates which gets propagated to worker nodes."
       tags: {
           "Name": `by nodegroup ${idForManagedNodegroup1}`,
       }
   }
};

Possible Solution

No response

Additional Information/Context

these lines might be related to it:
https://github.com/aws-quickstart/cdk-eks-blueprints/blame/ca3e9871abbcbce0d478924c44bbdb2d8ebe90bf/lib/cluster-providers/generic-cluster-provider.ts#L397

CDK CLI Version

2.86.0 (build 1130fab)

EKS Blueprints Version

1.10.0

Node.js Version

v18.12.1

Environment details (OS name and version, etc.)

amazonlinux 2023

Other information

No response

@OK-Apps OK-Apps added the bug Something isn't working label Jul 11, 2023
elamaran11 added a commit that referenced this issue Jul 11, 2023
@elamaran11 elamaran11 linked a pull request Jul 11, 2023 that will close this issue
elamaran11 added a commit that referenced this issue Jul 11, 2023
elamaran11 added a commit that referenced this issue Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants