cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

Allow arm64 image lookup based on instance type

Open khoavo-hatch opened this issue 3 years ago • 24 comments
trafficstars

What type of PR is this?

This is a bug fix PR to support looking up AMIs for arm64 machines.

/kind bug

What this PR does / why we need it:

Currently the logic for looking up AMIs does not take CPU architecture into account:

  • The default AMI lookup hard-codes the architecture to x86_64.
  • The EKS-optimized image lookup also only fetch the SSM parameter for x86 images.

So this PR adds logic to take into account the instance type's supported cpu architecture, so we will lookup images for the correct architecture.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #3121

Special notes for your reviewer:

Checklist:

  • [x] squashed commits
  • includes documentation (this is kind of a like a bug fix, so I don't think it needs docs)
  • [x] adds unit tests
  • [x] adds or updates e2e tests

Release note:

Action required: Added ability to look up x86_64 or arm64 images based on the instance type (#3121). Please rerun `clusterawsadm bootstrap iam create-cloudformation-stack` to give the controller permission to describe instance types.

khoavo-hatch avatar Feb 12 '22 11:02 khoavo-hatch

@khoavo-hatch: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Feb 12 '22 11:02 k8s-ci-robot

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: khoavo-hatch / name: Khoa Vo (0cb36445a6131d24e3b2065e7d0ddd061cc7d4ef)

@khoavo-hatch: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Feb 12 '22 11:02 k8s-ci-robot

Welcome @khoavo-hatch!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Feb 12 '22 11:02 k8s-ci-robot

Hi @khoavo-hatch. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Feb 12 '22 11:02 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign neolit123 after the PR has been reviewed. You can assign the PR to them by writing /assign @neolit123 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Feb 12 '22 11:02 k8s-ci-robot

Hey @khoavo-hatch Thanks for this PR 🎉 Are you still up for this? if yes, could you please rebase your PR

shivi28 avatar Mar 24 '22 12:03 shivi28

Hey @khoavo-hatch Thanks for this PR 🎉 Are you still up for this? if yes, could you please rebase your PR

@shivi28 I mentioned in the PR note that there's a blocker (the ec2:DescribeInstanceTypes permission issue). If there's no way out of this then we'll just have to abandon this PR. So there's no use in rebasing anyway right now.

khoavo-hatch avatar Mar 24 '22 15:03 khoavo-hatch

We can add that permission to CloudFormation policies in clusterawsadm.

sedefsavas avatar Mar 24 '22 17:03 sedefsavas

We can add that permission to CloudFormation policies in clusterawsadm.

Wouldn't that break backward compatibility?

khoavo-hatch avatar Mar 24 '22 17:03 khoavo-hatch

Since this is a new support, we could document the requirement to rerun clusterawsadm or add the permission manually to the IAMs.

cc @richardcase

sedefsavas avatar Mar 24 '22 19:03 sedefsavas

Since this is a new support, we could document the requirement to rerun clusterawsadm or add the permission manually to the IAMs.

Yes we need to let the users know as part of the release. Now that we don't use the release-notes plugin we need a way to flag up a issue/pr as requiring a note to the user during release.

richardcase avatar Apr 11 '22 11:04 richardcase

Thanks, I'll update the PR some time this week.

khoavo-hatch avatar Apr 11 '22 12:04 khoavo-hatch

You will need to sign the CLA by clicking on the failed CLA job. If this is ready for another review, you can delete the WIP from the title.

sedefsavas avatar Apr 15 '22 16:04 sedefsavas

@sedefsavas I've signed the CLA, and set PR ready for review now.

khoavo-hatch avatar Apr 15 '22 16:04 khoavo-hatch

/ok-to-test

richardcase avatar Jun 17 '22 07:06 richardcase

@khoavo-hatch - there appear to be a few linting issues. When you get time could you run make lint?

richardcase avatar Jun 17 '22 15:06 richardcase

Okay I've fixed all the lint issues. /test pull-cluster-api-provider-aws-test (was this necessary?)

khoavo-hatch avatar Jun 23 '22 15:06 khoavo-hatch

@khoavo-hatch: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-aws-apidiff-main 3a7ce16fac64378a96c7437fb64de38019c8fbe4 link false /test pull-cluster-api-provider-aws-apidiff-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

k8s-ci-robot avatar Jun 23 '22 15:06 k8s-ci-robot

@khoavo-hatch - we can ignore this apidiff error

richardcase avatar Jun 24 '22 13:06 richardcase

/test ?

richardcase avatar Jun 24 '22 13:06 richardcase

@richardcase: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jun 24 '22 13:06 k8s-ci-robot

/test pull-cluster-api-provider-aws-e2e /test pull-cluster-api-provider-aws-e2e-eks

richardcase avatar Jun 24 '22 13:06 richardcase

@khoavo-hatch: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Aug 04 '22 05:08 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 02 '22 06:11 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Dec 02 '22 06:12 k8s-triage-robot

@khoavo-hatch would you be able to continue with this PR?

Ankitasw avatar Dec 02 '22 10:12 Ankitasw

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Jan 01 '23 10:01 k8s-triage-robot

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jan 01 '23 10:01 k8s-ci-robot