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

k8s-ci-robot commented Jun 22, 2022

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
@k8s-ci-robot k8s-ci-robot requested review from gnufied and nckturner Jun 22, 2022
@nckturner
Copy link
Contributor

nckturner commented Jun 22, 2022

/assign @nckturner @wongma7

@nckturner
Copy link
Contributor

nckturner commented Jun 22, 2022

/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

k8s-ci-robot commented Jun 22, 2022

@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

nckturner commented Jun 22, 2022

/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

prateekgogia commented Jun 22, 2022

/retest

Copy link
Contributor

@sftim sftim left a comment

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.

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 15, 2022

@prateekgogia: Those labels are not set on the issue: kind/bug

In response to this:

Seeing the bugfix mentioned in the changelog helps folks decide how to prioritize an upgrade.

Earlier we removed

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

I am not saying, I don't want to add to changelog. However, trying to figure where/what to add?

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 removed the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2022
@prateekgogia
Copy link
Contributor Author

prateekgogia commented Jul 15, 2022

/retest-required

@nckturner
Copy link
Contributor

nckturner commented Jul 15, 2022

However, trying to figure where/what to add?

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

@nckturner
Copy link
Contributor

nckturner commented Jul 15, 2022

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

prateekgogia commented Jul 15, 2022

Updated the description to include the change. PTAL.

@prateekgogia
Copy link
Contributor Author

prateekgogia commented Jul 15, 2022

/retest

@cheftako
Copy link
Member

cheftako commented Jul 15, 2022

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 15, 2022

[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 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

prateekgogia commented Jul 15, 2022

/retest

@k8s-triage-robot
Copy link

k8s-triage-robot commented Jul 15, 2022

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

k8s-triage-robot commented Jul 16, 2022

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

k8s-triage-robot commented Jul 16, 2022

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

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 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