Create eksctl nodegroup using terraform with overrideBootstrapCommand
Opened this issue · 0 comments
mukundjalan commented
We are creating eks cluster nodegroup using eksctl. After the creation of cluster, we would like to make some modification as to how the nodegroup is created, hence the creation of cluster and nodegroup are done in separate modules.
Currently we use a null_resource
to execute the eksctl command for nodegroup creation (cluster is created using the eksctl_cluster
terraform resource) using the nodegroup config as below
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: ${cluster_name}
region: ${region}
managedNodeGroups:
- name: ${node_group_name}
ami: "${ami_id}"
privateNetworking: true
instanceType: ${instance_type}
desiredCapacity: ${desired_size}
minSize: ${min_size}
maxSize: ${max_size}
volumeType: gp3
volumeSize: ${disk_size}
overrideBootstrapCommand: |
#!/bin/bash
/etc/eks/bootstrap.sh ${cluster_name} --kubelet-extra-args "--node-labels=eks.amazonaws.com/${node_group_name} --kube-reserved=cpu=${kubelet_cpu},memory=${kubelet_memory},ephemeral-storage=${kubelet_ephemeral_storage} --eviction-hard=memory.available<${eviction_threshold},nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<15% --kernel-memcg-notification=true"
iam:
instanceRoleARN: ${node_group_role_arn}
labels:
%{ for label_key, label_value in labels }
${label_key}: ${label_value}
%{ endfor ~}
I would like to use the terraform resource eksctl_nodegroup
to create this nodegroup but I cannot find any option to set overrideBootstrapCommand
. As ami
and overrideBootstrapCommand
work hand in hand for managed nodegroups, I believe I am missing something here