Port rate limiter to experimental charts (#4478)

This commit is contained in:
Nikola Jokic 2026-05-22 11:45:09 +02:00 committed by GitHub
parent dfcbd8344b
commit 79ddd38442
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 78 additions and 0 deletions

View File

@ -73,6 +73,11 @@ args:
{{- with .Values.controller.manager.config.k8sClientRateLimiterBurst }}
- "--k8s-client-rate-limiter-burst={{ . }}"
{{- end }}
{{- with .Values.controller.manager.config.rateLimiter }}
{{- with .name }}
- "--workqueue-rate-limiter={{ . }}"
{{- end }}
{{- end }}
{{- with .Values.controller.manager.config.healthProbeBindAddress }}
- "--health-probe-bind-address={{ . }}"
{{- end }}

View File

@ -0,0 +1,66 @@
suite: "Controller Deployment rate limiter"
templates:
- deployment.yaml
tests:
- it: should omit workqueue-rate-limiter flag by default
release:
name: "test-arc"
namespace: "test-ns"
asserts:
- notContains:
path: spec.template.spec.containers[0].args
content: "--workqueue-rate-limiter=bucket_rate_limiter"
- notContains:
path: spec.template.spec.containers[0].args
content: "--workqueue-rate-limiter=typed_rate_limiter"
- it: should include workqueue-rate-limiter flag when bucket_rate_limiter is configured
set:
controller:
manager:
config:
rateLimiter:
name: "bucket_rate_limiter"
release:
name: "test-arc"
namespace: "test-ns"
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--workqueue-rate-limiter=bucket_rate_limiter"
- it: should include workqueue-rate-limiter flag when typed_rate_limiter is configured
set:
controller:
manager:
config:
rateLimiter:
name: "typed_rate_limiter"
release:
name: "test-arc"
namespace: "test-ns"
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--workqueue-rate-limiter=typed_rate_limiter"
- it: should render both config and extraArgs in deterministic order
set:
controller:
manager:
config:
rateLimiter:
name: "bucket_rate_limiter"
container:
extraArgs:
- "--workqueue-rate-limiter=typed_rate_limiter"
release:
name: "test-arc"
namespace: "test-ns"
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--workqueue-rate-limiter=bucket_rate_limiter"
- contains:
path: spec.template.spec.containers[0].args
content: "--workqueue-rate-limiter=typed_rate_limiter"

View File

@ -44,6 +44,13 @@ controller:
k8sClientRateLimiterQPS: null
k8sClientRateLimiterBurst: null
## Workqueue rate limiter configuration.
## By default, controller-runtime uses a combined rate limiter with both a per-item
## exponential backoff and an overall token bucket (10 QPS, 100 bucket size).
## Valid names: "bucket_rate_limiter" (default), "typed_rate_limiter" (per-item only, no global token bucket).
# rateLimiter:
# name: "bucket_rate_limiter"
# The address the health probe endpoint binds to. Disabled if empty/null.
# When set, liveness and readiness probes are added to the controller pod.
# healthProbeBindAddress: ":8081"