-
Notifications
You must be signed in to change notification settings - Fork 321
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
Batch tagging controller create/delete tags calls #1120
base: master
Are you sure you want to change the base?
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
This issue is currently awaiting triage. If cloud-provider-aws contributors determine this is a relevant issue, they will accept it by applying the The 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. |
Hi @shiv-amz. 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 Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
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. |
Resources []string | ||
RateLimit float64 | ||
BurstLimit int | ||
EnableBatching bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale for making this configurable? If it's useful, a BatchSize
config option seems more flexible for tuning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we don't need the enable batching flag. I added this for my load testing, to easily compare results between batching versus single calls. I'll remove this in next rev.
@@ -64,6 +65,7 @@ const ( | |||
taggingControllerLabelKey = "k8s.io/cloud-provider-aws" | |||
|
|||
maxRequeuingCount = 9 | |||
workerQueueCount = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a useful config option, similar to --concurrent-node-syncs
, --concurrent-service-syncs
, etc.
for i := int32(0); i < workerQueueCount; i++ { | ||
go wait.Until(tc.work, tc.nodeMonitorPeriod, stopCh) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is parallelism of API calls gated by the batching-per-call option? these seem like 2 different concerns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are related since, with single concurrent thread, batching api calls does not work. If all calls are made by single thread, they won't ever get batched. So to enable batching, parallel threads consuming from workqueue is required.
As pointed above, will make workerQueueCount as configurable, and remove the batching flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot going on here :)
Is there a simpler way we could implement this? Could a goroutine in the tagging controller poll multiple items off the queue (if they're available) and fire off the request? In Karpenter, it makes sense why we'd need a decoupled "batcher" because controller-runtime
doesn't expose the underlying work queue to Reconcile
, but we have some more flexibility in this controller
Chatted offline -- we'll split this up into 2 PR's, one that adds a simple parallelism mechanism (with a worker pool), and we'll keep iterating on the batching approach. |
/kind feature
What this PR does / why we need it:
tagging-controller-enable-batching
flag.Special notes for your reviewer:
We have a similar batching for other EC2 calls in Karpenter
Does this PR introduce a user-facing change?:
NONE