Skip to content

docs(tutorials/aws): document AWS SDK credential provider chain#6444

Open
alekc wants to merge 5 commits into
kubernetes-sigs:masterfrom
alekc:docs/aws-credential-chain
Open

docs(tutorials/aws): document AWS SDK credential provider chain#6444
alekc wants to merge 5 commits into
kubernetes-sigs:masterfrom
alekc:docs/aws-credential-chain

Conversation

@alekc
Copy link
Copy Markdown

@alekc alekc commented May 17, 2026

What does it do ?

Documents that ExternalDNS resolves AWS credentials via the
aws-sdk-go-v2 default credential provider chain,
plus a concrete env-var example for the in-tree Helm chart.

Motivation

Fixes #5265. Per the thread, links to the SDK reference instead of
enumerating every credential source, and adds one minimal recipe.

More

  • Yes, this PR title follows Conventional Commits
  • N/A — docs-only
  • Yes, I updated end user documentation accordingly

alekc added 2 commits May 17, 2026 20:45
ExternalDNS resolves AWS credentials via the aws-sdk-go-v2 default credential
provider chain (provider/aws/config.go uses config.LoadDefaultConfig), so any
credential source the SDK supports works — including AWS_ACCESS_KEY_ID /
AWS_SECRET_ACCESS_KEY env vars, AWS_SHARED_CREDENTIALS_FILE / AWS_CONFIG_FILE,
EC2 instance profile, ECS container credentials, and EKS Pod Identity. The
tutorial previously documented only three deployment patterns (Node IAM Role,
mounted credentials file, IRSA), leaving users to guess that env vars work
or dig through Helm chart values.

Add a note pointing at the AWS SDK reference for the full chain plus a tip
showing the env-var pattern via the Helm chart's env: block, which is the
concrete recipe users have been reconstructing from scratch.

Refs kubernetes-sigs#5265
Be explicit that the env-var example targets the in-tree external-dns
Helm chart under charts/external-dns/, since multiple community charts
named "external-dns" exist with different value schemas.
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 17, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @alekc. 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.

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/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 17, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign szuecs for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 requested a review from u-kai May 17, 2026 19:55
@k8s-ci-robot k8s-ci-robot requested a review from vflaux May 17, 2026 19:55
Copy link
Copy Markdown
Member

@u-kai u-kai left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!
I've left a few comments, so please take a look.

Comment thread docs/tutorials/aws.md Outdated
> ExternalDNS resolves AWS credentials through the
> [AWS SDK for Go v2 default credential provider chain](https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/configure-gosdk.html#specifying-credentials).
> The methods documented below are the common deployment patterns, but any source supported
> by the SDK works without additional configuration in ExternalDNS — including environment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the NOTE block, I think it would be cleaner to just include the link to the SDK reference without listing envs.
Please let me know if I'm missing something.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

reduced overall explanation to keep it minimal

Comment thread docs/tutorials/aws.md Outdated
> precedence order.

> [!TIP]
> To pass static credentials as environment variables (e.g. when running outside AWS and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Helm values example looks good to me!
However, I'd prefer to see the TIP moved closer to the existing Static credentials section, since that's where users looking for credential setup would naturally land.

@ivankatliarchuk
Copy link
Copy Markdown
Member

#6201 (comment)

…lowing feedback

Signed-off-by: Alexander Chernov <alexander@chernov.it>
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 19, 2026
…cumentation

Signed-off-by: Alexander Chernov <alexander@chernov.it>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 19, 2026
@alekc
Copy link
Copy Markdown
Author

alekc commented May 19, 2026

#6201 (comment)

Added risks from usage of static vars. Amended other 2 notes

@ivankatliarchuk
Copy link
Copy Markdown
Member

/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 May 19, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented May 19, 2026

Coverage Report for CI Build 26185204036

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.01%) to 80.621%

Details

  • Coverage decreased (-0.01%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 8 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

8 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
template/engine.go 8 92.79%

Coverage Stats

Coverage Status
Relevant Lines: 21405
Covered Lines: 17257
Line Coverage: 80.62%
Coverage Strength: 1450.78 hits per line

💛 - Coveralls

Comment thread docs/tutorials/aws.md
Comment on lines +273 to +280
> **For AWS specifically, the best practice and recommended hierarchy is:**
> 1. **IRSA (preferred):** Map an AWS IAM role to a Kubernetes service account; no static credentials in the pod.
> 2. **EKS Pod Identity:** Native EKS alternative to IRSA; associates IAM role with a service account via the Pod Identity Agent.
> 3. **Node IAM Role:** Attach policy to the node instance profile; not recommended beyond tests because all pods on the node inherit the permissions. Tolerated, but not recommended.
> 4. **Mount credentials file:** Minimize privileges and avoid long-lived keys where possible.
> 5. **Environment variables:** Minimize privileges and avoid long-lived keys where possible.

This method is not the preferred method as the secrets in the credential file or environment variables could be copied and used by an unauthorized threat actor.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree with highlighting the risks of static credentials.

For the AWS-specific recommendations, would it make sense to simplify this section and instead link to the official AWS guidance?(e.g: https://docs.aws.amazon.com/eks/latest/userguide/service-accounts.html)

I think that may age better than maintaining a recommendation hierarchy directly in this document.

@ivankatliarchuk
What do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I can link it. My issue with simplification here is that AWS guidance doesn't really says whats the optimal hierarchy for all different creds. We could add a link with for the latest and up to date guidance check http://xxx at the bottom of the note?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think adding the AWS official guidance link makes sense.

Maybe we can:

  • keep the warning about static credentials,
  • briefly mention commonly recommended approaches such as IRSA and EKS Pod Identity,
  • and point readers to the official AWS documentation for the latest and most accurate guidance.

That would keep the document useful while reducing long-term maintenance and recommendation drift.

…ction

The Lint workflow rejected the previous commits with MD004/MD030/MD032/
MD028/MD031/MD022 violations against the static-credentials blockquote.
Convert bullet markers from `*` to `-` (MD004) and trim the spacing after
markers to one space (MD030). Add the blank-blockquote separator lines
before each list inside a blockquote (MD032). Add a non-blockquote
separator between the two consecutive `[!TIP]` callouts (MD028). Add the
blank line between the closing fence and the next heading (MD031, MD022).

Refs: kubernetes-sigs#5265
Signed-off-by: Alexander Chernov <alexander@chernov.it>
@alekc
Copy link
Copy Markdown
Author

alekc commented May 20, 2026

Fixed markdown linting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. docs ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as env vars is undocumented

5 participants