mumoshu / terraform-provider-eksctl

Manage AWS EKS clusters using Terraform and eksctl
Apache License 2.0
234 stars 44 forks source link

Create nodegroups using config file or spec block #55

Open abhinavgpt opened 3 years ago

abhinavgpt commented 3 years ago

Hi :)

I am trying to add nodegroups dynamically to the cluster using the eksctl_nodegroup resource, but this resource currently only provides options which are supported by eksctl CLI. Unfortunately, I have to use the option overrideBootstrapCommand to set kubelet arguments, which is not supported by the CLI. I cannot add this nodegroup in the eksctl_cluster resource since nodegroups are created and deleted dynamically. Is there any way to do this using this provider?

Essentially I am looking to be able to add nodegroups to an existing cluster using code like:

resource "eksctl_nodegroup" "default" {
  name = "ng1"
  region = us-east-1
  cluster = test-cluster
  spec       = <<-EOS
  managedNodeGroups:
    - name: ng1
      privateNetworking: true
      instanceType: t3.medium
      ami: "ami-0ef0c69399dbb5f3f"
      overrideBootstrapCommand: |
          #!/bin/bash
          /etc/eks/bootstrap.sh test-cluster --kubelet-extra-args "--kube-reserved=cpu=140m,memory=2.6Gi"
  EOS
}

Any pointers are highly appreciated :)