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

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

Open
jwilms1971 opened this issue Aug 27, 2024 · 2 comments
Labels
docs Improvements or additions to documentation

Comments

@jwilms1971
Copy link

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 jwilms1971 added the docs Improvements or additions to documentation label Aug 27, 2024
@shapirov103
Copy link
Collaborator

@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.

@jwilms1971
Copy link
Author

jwilms1971 commented Aug 28, 2024

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 },
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants