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

Impossible to remove worker groups as described in readme.md #305

Open
babadofar opened this issue Sep 13, 2021 · 4 comments
Open

Impossible to remove worker groups as described in readme.md #305

babadofar opened this issue Sep 13, 2021 · 4 comments

Comments

@babadofar
Copy link
Contributor

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

Transitioning from Worker Groups to Worker Groups Launch Templates
In order to prevent any interruption to service, you'll first want to enable Worker Group Launch Templates.

Once you've verified that you are able to see the new Nodes created by the Launch Templates by running kubectl get nodes, then you can remove the older Worker Group.

To remove the older worker group, it's recommended to first scale down to zero nodes, one at a time, by adjusting the min/max node capacity. Once you've scaled down to zero nodes for the original worker group, and your workloads have been scheduled on nodes created by the launch templates you can set enable_worker_group to false.

module "eks-jx" { source = "jenkins-x/eks-jx/aws" enable_worker_group = false enable_worker_groups_launch_template = true allowed_spot_instance_types = ["m5.large", "m5a.large", "m5d.large", "m5ad.large", "t3.large", "t3a.large"] lt_desired_nodes_per_subnet = 2 lt_min_nodes_per_subnet = 2 lt_max_nodes_per_subnet = 3 }

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 :)

@babadofar
Copy link
Contributor Author

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 ? [

@ankitm123
Copy link
Member

ankitm123 commented Sep 18, 2021

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.

@babadofar
Copy link
Contributor Author

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?

@ankitm123
Copy link
Member

ankitm123 commented Sep 18, 2021

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 😬 https://github.com/jenkins-x/terraform-aws-eks-jx/tree/master/test

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

2 participants