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

Auto-resolver isn't auto-resolving to the newest AMI. #218

Closed
brentley opened this issue Sep 19, 2018 · 6 comments
Closed

Auto-resolver isn't auto-resolving to the newest AMI. #218

brentley opened this issue Sep 19, 2018 · 6 comments
Assignees
Labels

Comments

@brentley
Copy link

When using auto, in us-west-2, we get ami-08cab282f9979fc7a which is amazon-eks-node-v23 but we should get ami-0a54c984b9f908c81 which is amazon-eks-node-v24

✔ ~/git/eksworkshop/content [apps|✔]
23:43 $ eksctl create cluster --name=eksworkshop-eksctl --nodes=3 --node-ami=auto -v 3 |tee ~/eksoutput.log
2018-09-18T23:44:05-05:00 [ℹ]  setting availability zones to [us-west-2b us-west-2c us-west-2a]
2018-09-18T23:44:07-05:00 [ℹ]  using "ami-08cab282f9979fc7a" for nodes
2018-09-18T23:44:07-05:00 [ℹ]  creating EKS cluster "eksworkshop-eksctl" in "us-west-2" region
2018-09-18T23:44:07-05:00 [ℹ]  will create 2 separate CloudFormation stacks for cluster itself and the initial nodegroup
2018-09-18T23:44:07-05:00 [ℹ]  if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-west-2 --name=eksworkshop-eksctl'
2018-09-18T23:44:07-05:00 [ℹ]  creating cluster stack "eksctl-eksworkshop-eksctl-cluster"
^C

But when I use --node-ami to specify the newest ami id, it appears to work, so that's cool.

✘-INT ~/git/eksworkshop/content [apps|✔]
23:44 $ eksctl create cluster --name=eksworkshop-eksctl --nodes=3 --node-ami=ami-0a54c984b9f908c81 -v 3 |tee ~/eksoutput.log
2018-09-18T23:51:42-05:00 [ℹ]  setting availability zones to [us-west-2a us-west-2c us-west-2b]
2018-09-18T23:51:42-05:00 [ℹ]  using "ami-0a54c984b9f908c81" for nodes
2018-09-18T23:51:42-05:00 [ℹ]  creating EKS cluster "eksworkshop-eksctl" in "us-west-2" region
2018-09-18T23:51:42-05:00 [ℹ]  will create 2 separate CloudFormation stacks for cluster itself and the initial nodegroup
2018-09-18T23:51:42-05:00 [ℹ]  if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-west-2 --name=eksworkshop-eksctl'
2018-09-18T23:51:42-05:00 [ℹ]  creating cluster stack "eksctl-eksworkshop-eksctl-cluster"

Originally posted by @brentley in #197 (comment)

@richardcase
Copy link
Contributor

@brentley - thanks for raising the issue. I'll look into it now.

@richardcase
Copy link
Contributor

Running the following:

aws ec2 describe-images \
    --filters \
        Name=owner-id,Values=602401143452 \
        Name=virtualization-type,Values=hvm \
        Name=root-device-type,Values=ebs \
        Name=is-public,Values=true \
        Name=name,Values=amazon-eks-node-\* \
    --output text \
    --query 'max_by(Images[], &CreationDate).ImageId' \
    --region us-west-2

I see that i get the ami as ami-0a54c984b9f908c81. So the auto resolver has a bug in it and i suspect that its related to the --query 'max_by(Images[], &CreateionDate).ImageId.

I'll fix this.

@richardcase
Copy link
Contributor

On looking further its because 2 images are being returned and we are currently just picking the first and not taking into consideration creation time:

https://github.com/weaveworks/eksctl/blob/master/pkg/ami/api.go#L78

My bad. Updating this now.

@richardcase richardcase changed the title I think we need to reopen #197 ... it appears the auto-resolver isn't auto-resolving to the newest AMI. Auto-resolver isn't auto-resolving to the newest AMI. Sep 19, 2018
richardcase added a commit that referenced this issue Sep 19, 2018
The auto AMI resolver will now pick the latest AMI version to use.
Previously it just picked the first image and used that.

Issue #218
@richardcase
Copy link
Contributor

@brentley - thanks for highlighting this. I've made a fix and i've created PR #219. Hopefully this fix will be in the next release.

richardcase added a commit that referenced this issue Sep 19, 2018
* Auto resolver updated

The auto AMI resolver will now pick the latest AMI version to use.
Previously it just picked the first image and used that.

Issue #218

* Static Resolver updated to use latest AMIs

The static resolver has been updated to use the latest (v24)
images for the EKS nodes. This applies to both normal and
GPU instance types.
@richardcase
Copy link
Contributor

@brentley - 0.1.3 was released yesterday with a fix for this. Would you be able to see if the issue is fixed for you?

@brentley
Copy link
Author

looks good!

2018-09-20T15:55:31Z [ℹ]  setting availability zones to [us-west-2b us-west-2a us-west-2c]
2018-09-20T15:55:31Z [▶]  resolving AMI using AutoResolver for region us-west-2 and instanceType m5.large
2018-09-20T15:55:32Z [ℹ]  using "ami-0a54c984b9f908c81" for nodes

torredil pushed a commit to torredil/eksctl that referenced this issue May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants