Implement Agent Workload API Rate Limiting and fix rootless image builds#6783
Closed
Pittu-Sharma wants to merge 2 commits intospiffe:mainfrom
Closed
Implement Agent Workload API Rate Limiting and fix rootless image builds#6783Pittu-Sharma wants to merge 2 commits intospiffe:mainfrom
Pittu-Sharma wants to merge 2 commits intospiffe:mainfrom
Conversation
- Implement shared ratelimit package with Map and GC - Refactor server and agent middleware to use shared ratelimit - Add WorkloadAPIRateLimit to agent configuration and CLI - Update Makefile to support custom BUILDX_BUILDER and rootless DIND (spiffe#5140)
Collaborator
|
Hi @Pittu-Sharma, thanks for opening this PR. There's already one for this issue open, #6724, which is now going through some review cycles. We'll close this one in favour of that one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Affected functionality
Workload API (Agent), Server Middleware, and Image Build process.
Description of change
This PR adds rate limiting to the Agent Workload API and fixes failures when building images in restricted environments (e.g., rootless DinD).
Key updates:
pkg/common/ratelimitpackage. It provides a thread-safe map with background garbage collection for inactive limiters.workload_api_rate_limitto the agent configuration (HCL and CLI).container-buildertarget to check for existing builders and introduced aBUILDX_BUILDERvariable. This prevents failures in rootless environments where the defaultdocker-containerdriver may lack necessary permissions (make images fails for rootless docker in docker #5140).Which issue this PR fixes
Fixes #5140