Open AndreiBanaruTakeda opened 1 week ago
unfortunately, without a reproduction we will only be able to speculate
I've updated the issue to include the IaC for reproduction
Running:
aws eks update-nodegroup-version --cluster-name my-cluster --nodegroup-name my-cluster-S-NG-001 --kubernetes-version "1.30" --release-version "1.20.5-a3e8bda1"
will upgrade the cluster as per expectations, the release version won't be bumped to 1.21.1-82691b51
.
why are you doing this:
ami_release_version = data.aws_ssm_parameter.image_version[0].value
...
}
data "aws_ssm_parameter" "image_version" {
count = var.ami_release_version != null ? 1 : 0
name = "/aws/service/bottlerocket/aws-k8s-${module.eks.cluster_version}/x86_64/${var.ami_release_version}/image_version"
}
instead of this:
ami_release_version = var.ami_release_version
...
}
Personal preference.
I like it simple: 1.20.5 instead of 1.20.5-a3e8bda1.
I'm open to flip it if that causes the issue.
I don't follow - you are inputting the value of 1.20.5-a3e8bda1
via the ami_release_version
variable, only to look it up from the SSM parameter and get the exact same value back. If you already know the release version, just use it as a string and pass it to the input
I am inputting the value of 1.20.5
via the ami_release_version
variable, and then the SSM parameter resolves it to the extended format, which I then use in the eks-managed-node-group
module.
aws ssm get-parameter --name "/aws/service/bottlerocket/aws-k8s-1.30/x86_64/1.20.5/image_version" --region us-east-1 --query "Parameter.Value" --output text
There are two paths published in SSM to retrieve the image_version:
/aws/service/bottlerocket/aws-k8s-1.30/x86_64/1.20.5/image_version
/aws/service/bottlerocket/aws-k8s-1.30/x86_64/1.20.5-a3e8bda1/image_version
thats not what your reproduction details provided above show
I wasn't sufficiently clear. Sorry about that.
Those values you've just pointed out, are the ones supplied to the eks-managed-node-group
child module. The resolved ones, if we were to say it like this.
The reproduction code, which I added as an edit to the opened issue shows that I'm passing the short version of the version:
variable "ami_release_version" {
type = string
default = "1.20.5"
}
Description
This issue is mainly related to the submodule eks-managed-node-group.
We use
ami_type = "BOTTLEROCKET_x86_64"
coupled withcluster_version
andami_release_version
variables.The
ami_release_version
is configured for us in a TFE Variable Set, applied to our TFE workspaces. This way we can control the version at mass.cluster_version
is a data call to the EKS cluster so we retrieve its actual running version.Let's consider the initial values:
If the control plane is upgraded to
1.29
and I run a new plan and apply for the node-group configuration, the node-groups will be updated tocluster_version = 1.29
but theami_release_version
will be1.21.1-82691b51
(which is latest, as of today).I have to run a new plan and apply to bring the nodes back to the target
ami_release_version
:⚠️ Note
Before you submit an issue, please perform the following first:
.terraform
directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!):rm -rf .terraform/
terraform init
Versions
Reproduction Code [Required]
Steps to reproduce the behavior:
vpc_id
andsubnet_ids
according your environmentcluster_version
variable to1.29
and apply1.28
to1.29
1.29
AMI but with arelease_version
of1.21.1-82691b51
instead of1.20.5-a3e8bda1
Expected behavior
When both
cluster_version
andami_release_version
variables change, they should be reconciliated in one plan and apply.Actual behavior
Two plans and apply are required to bring the nodes to a specific
cluster_version
andami_release_version
.First plan will bring the
cluster_version
to the target version and theami_release_version
to the latest available version.The second plan will downgrade the
ami_release_version
to the desired value.Terminal Output Screenshot(s)
Update history tab:
Additional context