Terraform
Fleetingterraform
Produit de Hashicorp.
eks nodegroup desired_size not updated
- Référence externe : https://github.com/bryantbiggs/eks-desired-size-hack
- Référence externe : https://github.com/terraform-aws-modules/terraform-aws-eks/issues/2030
You can do it manually with awscli using
cluster_name="$(aws eks list-clusters | jq -r .clusters[0])"
nodegroup_name="$(aws eks list-nodegroups --cluster-name "${cluster_name}"|jq -r .nodegroups[0])"
aws eks update-nodegroup-config --nodegroup-name "${nodegroup_name}" --cluster-name "${cluster_name}" --scaling-config 'maxSize=3'
aws eks update-nodegroup-config --nodegroup-name "${nodegroup_name}" --cluster-name "${cluster_name}" --scaling-config 'desiredSize=3'
{
"update": {
"id": "8e6df717-99e3-310c-80ba-ce2747e474aa",
"status": "InProgress",
"type": "ConfigUpdate",
"params": [
{
"type": "DesiredSize",
"value": "3"
}
],
"createdAt": "2024-08-09T16:08:44.445000+02:00",
"errors": []
}
}
Autoscaling of nodes via cluster autoscaler or Karpenter is the preferred method by many
— https://github.com/terraform-aws-modules/terraform-aws-eks/issues/2030
Terraform does not allow for parameterizing ignore_changes at this time so this is the default effect
— https://github.com/terraform-aws-modules/terraform-aws-eks/issues/2030
It is assumed that most users will utilize a form of autoscaling that will manage the desired_size attribute of the node groups (i.e. - Cluster Autoscaler will manage this attribute for scaling), and therefore Terraform should not attempt to manage after it has been initially set during creation of the node group.