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

Create eksctl nodegroup using terraform with overrideBootstrapCommand #60

Open
mukundjalan opened this issue Nov 12, 2021 · 0 comments
Open

Comments

@mukundjalan
Copy link

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

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

No branches or pull requests

1 participant