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

Add rate limiting when calling STS assume role API #110706

Merged
merged 2 commits into from Jul 16, 2022

Conversation

prateekgogia
Copy link
Contributor

@prateekgogia prateekgogia commented Jun 22, 2022

What type of PR is this?

/kind bug

What this PR does / why we need it:

Adds rate limiting for Assume role call when failing to assume an IAM role in CCM. It caches the assume role API call result for 1 second and blocks all call till the cache is valid.

The below screenshot shows the result of this change, reduction in assumeRole API calls after this change was applied at 05:10.

AssumeRoleAPICount

Which issue(s) this PR fixes:

Fixes #
kubernetes/cloud-provider-aws#284

Special notes for your reviewer:

Does this PR introduce a user-facing change?

[aws] Fixed a bug which reduces the number of unnecessary calls to STS in the event of assume role failures in the legacy cloud provider

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

None

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 22, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @prateekgogia. Thanks for your PR.

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

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added area/cloudprovider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 22, 2022
@nckturner
Copy link
Contributor

/assign @nckturner @wongma7

@nckturner
Copy link
Contributor

/ok-to-test
/triage accepted
/priority important-soon

@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. triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 22, 2022
@nckturner
Copy link
Contributor

nckturner commented Jun 22, 2022

/area provider-aws

@k8s-ci-robot
Copy link
Contributor

@nckturner: The label(s) area/provider-aws cannot be applied, because the repository doesn't have them.

In response to this:

/area provider-aws

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/test-infra repository.

@nckturner
Copy link
Contributor

/area provider/aws

@k8s-ci-robot k8s-ci-robot added the area/provider/aws Issues or PRs related to aws provider label Jun 22, 2022
@prateekgogia
Copy link
Contributor Author

/retest

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

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

I'd like to see a test that shows what happens when trying to assume a different IAM role within 1 second of a previous successful attempt. That feels like the most important test to have, to be honest.

/remove-kind bug
Lack of cache is not a bug.

@nckturner
Copy link
Contributor

However, trying to figure where/what to add?

See my suggestion above and let me know what you think.

@nckturner
Copy link
Contributor

Also, I'm going to re-label it as a bug, as this is causing issues for EKS users.

/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. labels Jul 15, 2022
@prateekgogia
Copy link
Contributor Author

Updated the description to include the change. PTAL.

@prateekgogia
Copy link
Contributor Author

/retest

@cheftako
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheftako, prateekgogia

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 15, 2022
@prateekgogia
Copy link
Contributor Author

/retest

@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

1 similar comment
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 16, 2022

@prateekgogia: 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-kubernetes-e2e-kind 3f412cd link true /test pull-kubernetes-e2e-kind
pull-kubernetes-e2e-gce-ubuntu-containerd 3f412cd link true /test pull-kubernetes-e2e-gce-ubuntu-containerd

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

@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit 5b92e46 into kubernetes:master Jul 16, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone Jul 16, 2022
k8s-ci-robot added a commit that referenced this pull request Dec 12, 2022
…-#110706-upstream-release-1.23

Automated cherry pick of #110706: Add rate limiting when calling STS assume role API
k8s-ci-robot added a commit that referenced this pull request Dec 13, 2022
…-#110706-upstream-release-1.24

Automated cherry pick of #110706: Add rate limiting when calling STS assume role API
Swizzmaster pushed a commit to Swizzmaster/kubernetes that referenced this pull request Feb 29, 2024
Swizzmaster pushed a commit to Swizzmaster/kubernetes that referenced this pull request Feb 29, 2024
Cherry pick from k/k PR kubernetes#110706 v1.20-1.23

See merge request eks-dataplane/eks-kubernetes-patches!23
Swizzmaster pushed a commit to Swizzmaster/kubernetes that referenced this pull request Feb 29, 2024
Swizzmaster pushed a commit to Swizzmaster/kubernetes that referenced this pull request Feb 29, 2024
Fix kubernetes#110706 patch naming

See merge request eks-dataplane/eks-kubernetes-patches!29
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/cloudprovider area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants