Open babadofar opened 3 years ago
Sorry I linked up the wrong conditional and didn't even read what I pasted in.
The correct, erroneous code is here https://github.com/jenkins-x/terraform-aws-eks-jx/blob/master/modules/cluster/main.tf#L71
worker_groups_launch_template = var.enable_worker_group && var.enable_worker_groups_launch_template ? [
Were u trying to switch between self managed eks worker nodes and eks managed nodes? Setting enable_worker_group to true will provision self managed nodes (https://docs.aws.amazon.com/eks/latest/userguide/worker.html) and setting it to false will provision eks managed node groups (https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) It has nothing to do with launch template.
Yes except launch templates will only be added if you set worker groups =true . If you follow the conditionals you will see this. Are there tests for this by the way?
Are there tests for this by the way?
I started writing terragrunt tests for this, but we dont have EKS infrastructure to test this atm :grimacing: https://github.com/jenkins-x/terraform-aws-eks-jx/tree/master/test
Summary
The documentation describes that you can disable worker groups. However, if you try to do that you will no longer have worker groups launch templates due to the logic. The documentation states
However in the code there is a conditional that only allows worker groups launch templates if you also have enabled worker groups https://github.com/jenkins-x/terraform-aws-eks-jx/blob/master/modules/cluster/main.tf#L99
worker_groups = var.enable_worker_group && !var.enable_worker_groups_launch_template ? [
I'm not quite sure what the correct approach here would be. But the documentation is misleading, and the config is confusing :)