Skip to content

Conversation

@domenicbozzuto
Copy link
Contributor

@domenicbozzuto domenicbozzuto commented Dec 5, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Updates cloudprovider/aws to use the new aws-sdk-go-v2. Notably, the v2 sdk is not vendored as the v1 sdk was. The individual servcies are now independent modules, vs using a large single monolithic version as the previous SDK did. The original aws-sdk-go package is officially deprecated, and the repo is now archived.

The changes from the v1 SDK are generally as follows:

  • API types and methods are now split into distinct packages
  • Many API types changed to no longer use pointers to data
  • New API to innitiate an API (session.NewSession dropped)
  • Use of aws/smithy-go for configuring API middleware
  • Updates to override endpoint resolution

I can formally remove the old vendored aws-sdk-go package in a subsequent PR, but didn't want to obscure the diff with the removal of 2000+ files.

Which issue(s) this PR fixes:

Fixes # #8671

Special notes for your reviewer:

There is some context in other PRs. I originally planned to vendor the aws-sdk-go-v2 as the v1 sdk was vendored; this work was done in #8265, and planned to consumed the vendored package with #8269.

However:

  • The v2 sdk is significantly larger than v1 sdk
  • Each API service is versioned independently, whereas v1 was monolithically versioned.

From the discussion on that PR, it was suggested it might make more sense to not vendor the package and use it directly; this is similar to how the new azure SDK for go is being handled.

Does this PR introduce a user-facing change?

Use AWS SDK v2, deprecate v1

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Updates cloudprovider/aws to use the new aws-sdk-go-v2.
Notably, the v2 sdk is not vendored as the v1 sdk was.
The individual servcies are now independent modules, vs
using a large single monolithic version as the previous
SDK did.

The changes from the v1 SDK are generally as follows:
* API types and methods are now split into distinct packages
* Many API types changed to no longer use pointers to data
* New API to innitiate an API (session.NewSession dropped)
* Use of aws/smithy-go for configuring API middleware
* Updates to override endpoint resolution
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/needs-area area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 5, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @domenicbozzuto. Thanks for your PR.

I'm waiting for a github.com 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.

Details

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 5, 2025
@domenicbozzuto
Copy link
Contributor Author

/cc @jackfrancis

Tagging you as you have context on the other PR and discussed this with me in the sig-autoscaling meeting this week 👍

@jackfrancis
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 10, 2025
@jackfrancis
Copy link
Contributor

@domenicbozzuto thank you for this, looks good!

Are you willing to make a few housekeeping changes to the brightbox cloudprovider usage of the archived v1 SDK? It looks to me that once we remove those references, we can remove the v1 sdk from the core go.mod entirely, which would be a significant win IMO.

The brightbox provider was the last remaining package that still consumed the v1 sdk. The code to generate the mocks in this SDK is not present here, so a small adapter struct was introduced to provide compatibility with the v2 sdk.
@domenicbozzuto
Copy link
Contributor Author

domenicbozzuto commented Dec 10, 2025

Thanks! 💯 Housekeeping has been taken care of; it looks like the most recent release of https://github.com/brightbox/k8ssdk (where I presume the vendored code here is from) still depends on the v1 SDK, so I introduced a small adapter to the v2 sdk to keep the interfaces the same (the MetadataClient() function is not actually called anywhere in the cluster-autoscaler, so we could also drop it if that's preferred).

go.mod should no longer contains any direct dependencies on the v1 sdk

@jackfrancis
Copy link
Contributor

@domenicbozzuto that's a thing of beauty, thank you

cc @NeilW

Copy link
Contributor

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 11, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: domenicbozzuto, jackfrancis

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

The pull request process is described here

Details 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 11, 2025
@k8s-ci-robot k8s-ci-robot merged commit ff803d5 into kubernetes:master Dec 11, 2025
8 checks passed
@jackfrancis
Copy link
Contributor

/release-note-edit

Use AWS SDK v2, deprecate v1

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants