aws-samples / eks-cluster-upgrade

Automated Amazon EKS cluster upgrade
MIT No Attribution
154 stars 34 forks source link

Bug: Launch template details can't be null for Custom ami type node group #123

Closed hoangminhtu-dh closed 1 year ago

hoangminhtu-dh commented 1 year ago

Expected Behaviour

I'm running into an issue similar to this, whose solution was implemented in eksctl with this PR.

Current Behaviour

eksupgrade command's relevant output:

Getting cluster managed nodegroup details...
Managed Node Group: <EXAMPLE_MNG> - Version: 1.23 - Release Version: ami-0c099795affa953de - Cluster: <CLUSTER_NAME>

Updating nodegroup: k8s-qa-eu-cluster-xl-coredns-v1 from version: 1.23 to version: 1.24
Exception encountered! Error: An error occurred (InvalidParameterException) when calling the UpdateNodegroupVersion operation: Launch template details can't be null for Custom ami type node group

Code snippet

N/A

Possible Solution

https://github.com/weaveworks/eksctl/pull/6318

Steps to Reproduce

N/A

Amazon EKS upgrade version

1.24

Python runtime version

3.11

Packaging format used

PyPi

Debugging logs

No response

hoangminhtu-dh commented 1 year ago

As per https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateNodegroupVersion.html#API_UpdateNodegroupVersion_RequestBody -> version:

The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI version of the cluster's Kubernetes version. If you specify launchTemplate, and your launch template uses a custom AMI, then don't specify version, or the node group update will fail. For more information about using launch templates with Amazon EKS, see [Launch template support](https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html) in the Amazon EKS User Guide.

We need not the and version part in this elif line: https://github.com/aws-samples/eks-cluster-upgrade/blob/0362c8f21c1169082bee941678d7d192ce4fec21/eksupgrade/models/eks.py#L354-L355, and just echo_error when there exists a launch template, and ami_type is CUSTOM.

github-actions[bot] commented 1 year ago

This issue has not received any attention in 30 days. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.