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

aws: use http async client to fetch metadata credentials #30626

Merged

Conversation

suniltheta
Copy link
Contributor

Commit Message: aws: use http async client to fetch metadata credentials

Additional Description:
This is part #2 of set of changes to update common aws extension utility to make use of http async client to fetch aws credentials metadata instead of using libcurl.

Previous PR #29880 introduced a class MetadataFetcher and a function in utility.cc to add internal static cluster config. In this PR we are adding functionality into InstanceProfileCredentialsProvider and TaskRoleCredentialsProvider to use MetadataFetcher object to fetch the credentials instead of using libcurl.

Risk Level: Low
Testing: Added unit testing to cover the new code path
Docs Changes: Updated
Release Notes: Updated
Platform Specific Features: NA
Runtime guard: envoy.reloadable_features.use_libcurl_to_fetch_aws_credentials
Deprecated: libcurl


General Description about the overall effort:
For the effort to remove curl from Envoy #11816. This change will use http async client to make the call towards EC2 instance metadata & ECS task metadata service. To make http async client work it needs cluster manager with statically defined cluster configurations. If clusters with fixed names are not provided it will add the cluster during init.

There are 2 http filters with which this change works without issue

  1. AwsRequestSigning ✅
  2. AwsLambda ✅

However, with AWS IAM gRPC credentials provider plugin there is a problem ⚠️ The http async client will not support AWS IAM gRPC plugin because it needs Envoy server fully initialized before using cluster manager. When gRPC service tries to use the Cluster Manager the static clusters are not available for reasons explained on #27586. So in future changes if curl is removed entirely then we need to update docs to clearly state that AWS IAM gRPC plugin can only support Environment or File based credentials fetching. Other option is to add a curl version of AWS IAM gRPC credentials plugin into the contrib folder.

So far I am not aware if there are any Envoy users other than within AWS that uses AWS IAM gRPC plugin. Please let me know what is the best way to maintain it for everyone's convenience.

I have put a short doc to explain the implementation here https://docs.google.com/document/d/1m1KE_LGDnxrXwnUC1OEKYLmw8szy4r06OX_O3JcM-wM

Signed-off-by: Sunil Narasimhamurthy <sunnrs@amazon.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #30626 was opened by suniltheta.

see: more, trace.

@suniltheta
Copy link
Contributor Author

In this PR already addressed the initial set of code review comments given in #29880 (review)

ravenblackx
ravenblackx previously approved these changes Nov 2, 2023
Copy link
Contributor

@ravenblackx ravenblackx left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a couple of nits, thanks!

@ravenblackx
Copy link
Contributor

To @mattklein123 again for the senior maintainer pass, with the same caveats as last time (that it would have been nice if the CODEOWNERS did a pass first, but they were so conspicuously absent on the previous PR that it doesn't seem worth even inviting them this time.)

@ravenblackx ravenblackx removed their assignment Nov 2, 2023
use a method instead of checking for feature flag at
multiple locations.

Signed-off-by: Sunil Narasimhamurthy <sunnrs@amazon.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Nice! Exciting to see this finally being burned down.

@mattklein123 mattklein123 merged commit 3816b1a into envoyproxy:main Nov 4, 2023
102 of 104 checks passed
htuch pushed a commit that referenced this pull request Nov 7, 2023
Following the merge of #29880 and #30626 we can mark the curl usage as deprecated. Meanwhile bazel/repositories.bzl had stale info that OpenCensus tracer was still using libcurl.

We can continue to keep the Issue #11816 open until curl is removed entirely after the deprecation time (Probably for v1.31 release).

Signed-off-by: Sunil Narasimhamurthy <sunnrs@amazon.com>
@jbohanon jbohanon mentioned this pull request Mar 20, 2024
6 tasks
@alyssawilk
Copy link
Contributor

@suniltheta can this flag be flipped true? Otherwise it looks offhand like curl is still being used by default?

@suniltheta
Copy link
Contributor Author

cc: @nbaws to help with the flip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants