Skip to content

Conversation

wallrj
Copy link
Member

@wallrj wallrj commented Aug 16, 2024

An alternative approach to #7235.

Instead of creating a bespoke STS client and STS credential provider, this branch just uses the AWS-SDK LoadDefaultConfig mechanisms which creates an STS client if Assume role configuration is provided.

Fixes: #7102
Fixes: #5455
Fixes: cert-manager/website#56

Route53 ACME DNS Solver: Allow STS token to be refreshed by the AWS client if necessary, when using a non-mounted Kubernetes ServiceAccount token.

@cert-manager-prow

This comment was marked as outdated.

@cert-manager-prow cert-manager-prow bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. area/acme Indicates a PR directly modifies the ACME Issuer code area/acme/dns01 Indicates a PR modifies ACME DNS01 provider code area/api Indicates a PR directly modifies the 'pkg/apis' directory needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 16, 2024
ServiceAccountName: providerConfig.Route53.Auth.Kubernetes.ServiceAccountRef.Name,
Audiences: audiences,
Namespace: resourceNamespace,
Client: s.Client.CoreV1().ServiceAccounts(resourceNamespace),
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of creating a Kubernetes service account token every time we instantiate the solver,
this instead provides a custom IdentityTokenRetriever which the AWS-SDK can call as and when it needs the token.

This also allows the AWS client to refresh the STS token if the DNS-01 prepare or cleanup operations are delayed or if an AWS endpoint is unreachable or returns an error and the AWS client needs to retry any of the STS or Route53 operations.

@@ -630,6 +630,7 @@ type ServiceAccountRef struct {
// and name is always included.
// If unset the audience defaults to `sts.amazonaws.com`.
// +optional
// +default=["sts.amazonaws.com"]

This comment was marked as outdated.

wallrj

This comment was marked as outdated.

@cert-manager-prow cert-manager-prow bot 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 Aug 16, 2024
@cert-manager-prow cert-manager-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 7, 2024
@wallrj wallrj force-pushed the 7102-route53-sts-credential-provider-2 branch from d5079a0 to ad30b33 Compare September 10, 2024 08:43
@cert-manager-prow cert-manager-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 10, 2024
@wallrj wallrj force-pushed the 7102-route53-sts-credential-provider-2 branch 6 times, most recently from 5e5f1cb to 6d921ff Compare September 12, 2024 11:42
@cert-manager-prow cert-manager-prow bot added the area/deploy Indicates a PR modifies deployment configuration label Sep 12, 2024
@wallrj wallrj force-pushed the 7102-route53-sts-credential-provider-2 branch from 6d921ff to 0760094 Compare September 12, 2024 16:54
@jsoref
Copy link
Contributor

jsoref commented Sep 17, 2024

/kind bug feature

@wallrj wallrj force-pushed the 7102-route53-sts-credential-provider-2 branch 2 times, most recently from 1083eb7 to 4bed2f9 Compare September 27, 2024 14:20
@cert-manager-prow cert-manager-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 27, 2024
@wallrj wallrj changed the title WIP: Allow STS token to be refreshed by the AWS client if necessary Allow STS token to be refreshed by the AWS client if necessary Sep 27, 2024
@wallrj wallrj marked this pull request as ready for review September 27, 2024 14:23
@cert-manager-prow cert-manager-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 27, 2024
@wallrj wallrj force-pushed the 7102-route53-sts-credential-provider-2 branch 2 times, most recently from 3e74a05 to 5315300 Compare September 27, 2024 14:36
@wallrj wallrj changed the title Allow STS token to be refreshed by the AWS client if necessary Route53: Allow STS token to be refreshed by the AWS client if necessary Sep 27, 2024
…own STS client

Signed-off-by: Richard Wall <richard.wall@venafi.com>
@wallrj wallrj force-pushed the 7102-route53-sts-credential-provider-2 branch from 5315300 to 440cd54 Compare September 27, 2024 15:27
@wallrj wallrj requested a review from inteon October 16, 2024 22:27
RoleArn: aws.String(d.Role),
RoleSessionName: aws.String("cert-manager"),
})
case d.AccessKeyID != "" && d.SecretAccessKey != "":
Copy link
Member

Choose a reason for hiding this comment

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

It is very hard to follow the refactor of this switch statement, would it be possible to move this to a seperate PR?

@cert-manager-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
/lifecycle stale

@cert-manager-prow cert-manager-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 16, 2025
@cert-manager-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
/lifecycle rotten
/remove-lifecycle stale

@cert-manager-prow cert-manager-prow bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 26, 2025
@cert-manager-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
/close

@cert-manager-prow
Copy link
Contributor

@cert-manager-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
/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-sigs/prow repository.

@inteon
Copy link
Member

inteon commented Mar 28, 2025

/remove-lifecycle rotten

@inteon inteon reopened this Mar 28, 2025
@cert-manager-prow cert-manager-prow bot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Mar 28, 2025
@cert-manager-prow
Copy link
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 maelvls for approval. For more information see the Code Review Process.

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

@cert-manager-prow cert-manager-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2025
@cert-manager-prow
Copy link
Contributor

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

@cert-manager-prow
Copy link
Contributor

@wallrj: The following tests 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-cert-manager-master-make-test 440cd54 link true /test pull-cert-manager-master-make-test
pull-cert-manager-master-e2e-v1-33-upgrade 440cd54 link true /test pull-cert-manager-master-e2e-v1-33-upgrade

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-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/acme/dns01 Indicates a PR modifies ACME DNS01 provider code area/acme Indicates a PR directly modifies the ACME Issuer code area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
4 participants