aws-quickstart / cdk-eks-blueprints

AWS Quick Start Team
Apache License 2.0
431 stars 190 forks source link

VpcCniAddOn: As of 1.14.1, an error stating "Region is missing" is throwing in console #1015

Open tdalbo92 opened 2 weeks ago

tdalbo92 commented 2 weeks ago

Describe the bug

After the latest upgrade we're seeing ERROR messages in our console during cdk deploy regarding "Region is missing". It seems like three add-ons are affected: VpcCniAddOn, CoreDnsAddOn, and KubeProxyAddOn. This issue doesn't seem to actually affect the deploy, and isn't causing problems, but it seems like a regression regardless.

Expected Behavior

No error is thrown by these add-ons.

Current Behavior

Stacktrace:

2024-06-11 19:58:59.398 WARN    /node_modules/@aws-quickstart/eks-blueprints/lib/addons/core-addon/index.ts:208 main    
 Error  Region is missing
error stack:
  • index.js    default
    /node_modules/@smithy/config-resolver/dist-cjs/index.js:117
  • index.js    
    /node_modules/@smithy/node-config-provider/dist-cjs/index.js:90
  • index.js    
    /node_modules/@smithy/property-provider/dist-cjs/index.js:97
  • index.js    coalesceProvider
    /node_modules/@smithy/property-provider/dist-cjs/index.js:124
  • index.js    
    /node_modules/@smithy/property-provider/dist-cjs/index.js:135
  • index.js    region
    /node_modules/@smithy/config-resolver/dist-cjs/index.js:142
  • httpAuthSchemeProvider.js   Object.defaultEKSHttpAuthSchemeParametersProvider [as httpAuthSchemeParametersProvider]
    /node_modules/@aws-sdk/client-eks/dist-cjs/auth/httpAuthSchemeProvider.js:9
  • index.js    
    /node_modules/@smithy/core/dist-cjs/index.js:61
  • index.js    
    /node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:34
  • index.ts    VpcCniAddOn.provideVersion
    /node_modules/@aws-quickstart/eks-blueprints/lib/addons/core-addon/index.ts:187
2024-06-11 19:58:59.399 WARN    /node_modules/@aws-quickstart/eks-blueprints/lib/addons/core-addon/index.ts:209 main    Failed to retrieve add-on versions from EKS for add-on vpc-cni. Falling back to default version.

Reproduction Steps

Install any of the three aforementioned add-ons and run cdk deploy. The error seems to reliably happen.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.133.0

EKS Blueprints Version

1.14.1

Node.js Version

v18.20.1

Environment details (OS name and version, etc.)

MacOS 14.5 Sonoma ARM64

Other information

No response

shapirov103 commented 2 weeks ago

@tdalbo92 these addons use AWS SDK API call to detect the right version. Please make sure that either 1/ credentials are available at build time (e.g. aws configure has creds and region setup) or 2/ no credentials are available (in that case we fall back onto an internal map of versions, which may not be exactly what AWS has by default).

Another option to work around this issue is to pass the version to these addons, then the framework won't attempt to make any API calls.

@elamaran11 logically region should not be required, let's have a look at this issue.

elamaran11 commented 2 weeks ago

@tdalbo92 @shapirov103 The EKSClient on the sdk call needs region setup in the terminal to make api calls to retrieve the specific version of the addon. If region is not passed, it defaults to other methods, also see its a warning and not a hard error. So this is not an issue and this is how it works.