cdk-eks-blueprints icon indicating copy to clipboard operation
cdk-eks-blueprints copied to clipboard

customAMI is not a valid configuration property for Managed Node Group Cluster Provider

Open jwilms1971 opened this issue 1 year ago • 2 comments

Describe the documentation issue

The property customAMI is not defined by the MngClusterProviderProps API and probably should be replaced by LaunchTemplate.

As an aside, it would be helpful to have an example of how to configure a Bottlerocket environment (e.g., motd setting) using a LaunchTemplate.

Links

https://aws-quickstart.github.io/cdk-eks-blueprints/cluster-providers/mng-cluster-provider/

jwilms1971 avatar Aug 27 '24 05:08 jwilms1971

@jwilms1971 an example of using a launchtemplate is here.

To understand your request better, please describe how you pass the motd setting if it is done manually, e.g. without the blueprints? If it is within userdata, then the example I shared has an approach for this.

shapirov103 avatar Aug 27 '24 14:08 shapirov103

I did stumble across this example later in the day but when trying it out I discovered it didn't work correctly with Bottlerocket. Firstly, specifying a region-specific Bottlerocket machineImage caused the worker nodes not to join the cluster even after modifying the userdata section to include setting the Kubernetes cluster name in TOML format (the format in the example is for AL2).

I also had to remove specifying a machineImage and let the builder rely on the amiType to auto-select a Bottlerocket AMI ID which is contrary to what the documentation for launchTemplate implies (https://aws-quickstart.github.io/cdk-eks-blueprints/api/interfaces/clusters.MngClusterProviderProps.html#launchTemplate).

Here is my working example:

const userData = ec2.UserData.forLinux(); userData.addCommands(` [settings.kernel] lockdown = "integrity" [settings.kernel.modules.udf] allowed = false [settings.kernel.modules.sctp] allowed = false `);

const mngClusterProviderProps: blueprints.MngClusterProviderProps = { minSize: 0, maxSize: 10, desiredSize: 1, nodeGroupSubnets: { subnetGroupName: "Eks" }, privateCluster: true, instanceTypes: [new ec2.InstanceType('m7i.xlarge')], amiType: eks.NodegroupAmiType.BOTTLEROCKET_X86_64, nodeGroupCapacityType: eks.CapacityType.ON_DEMAND, nodeRole: blueprints.getNamedResource("node-role") as iam.Role, role: blueprints.getNamedResource("cluster-role") as iam.Role, launchTemplate: { userData: userData }, };

jwilms1971 avatar Aug 28 '24 00:08 jwilms1971

This issue has been automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] avatar Nov 27 '24 00:11 github-actions[bot]

Issue closed due to inactivity.

github-actions[bot] avatar Jan 26 '25 00:01 github-actions[bot]