Hi all ! What would be the best approach of creati...
# general
w
Hi all ! What would be the best approach of creating NodeGroups using EKS with some additional commands to run during bootstrap. I have tried a number of approaches provided by Pulumi but none of them seem to be working out. Using the AWS Classic package: • No feature to add any additional bootstrap commands Using the pulumi_eks package: • Using NodeGroups option will bring up the NodeGroups but the instances are not attached to the Cluster (Launch configuration does contain the commands though) • Using ManagedNodeGroups, Additional bootstrap commands not added to the launch template Would appreciate some guidance with this problem.
Based on my research,
AWS Classic package
has no option of adding, bootstrap commands at all. The best way over here would be to create an AMI based off of Amazon Linux 2 EKS optimized and then add the additional commands here
pulumi_eks
Add newly created NodeGroups to the cluster by following this article maybe? https://aws.amazon.com/premiumsupport/knowledge-center/eks-worker-nodes-cluster/
managed nodegroups in pulumi_eks
Same approach as AWS Classic package. I ve checked out this file from AWS Classic: https://github.com/pulumi/pulumi-aws/blob/master/sdk/go/aws/eks/nodeGroup.go and this from pulumi_eks: https://github.com/pulumi/pulumi-eks/blob/master/nodejs/eks/nodegroup.ts#L832-L920 both places there is no provision to add additional commands to the user data
b
This may be an obvious point, so apologies, would you not do this by creating a custom launch configuration/template and passing it to the node group?
w
That is going to be my next move, creating a custom Launch Template with the EKS AMI commands. I was curious if I was missing something obvious. Also the reason for all the digging was that eksctl allows the user to add additional commands using the
preBootstrapCommands
parameter. Any how thank you for responding and confirming my doubts 🙂
b
Yeah I'd have to look at the AWS API to see how it does it, whether eksctl is just creating a launch template behind the scenes or if this is supported more natively in some way.
w
whether eksctl is just creating a launch template behind the scenes
This is how they do it. Its a part of the CloudFormation template that comes up when they are bringing up the NodeGroup.