Skip to content

Commit a106ca6

Browse files
committed
refactor(helm): rework values for k8s client rate-limiter
1 parent e002b89 commit a106ca6

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

deploy/charts/x509-certificate-exporter/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ hostPathsExporter:
379379
| secretsExporter.priorityClassName | string | `""` | PriorityClassName for Pods of the TLS Secrets exporter |
380380
| secretsExporter.podExtraLabels | object | `{}` | Additional labels added to Pods of the TLS Secrets exporter |
381381
| secretsExporter.podAnnotations | object | `{}` | Annotations added to Pods of the TLS Secrets exporter |
382-
| secretsExporter.podSecurityContext | object | `{}` | PodSecurityContext for Pods of the TLS Secrets exporter |
382+
| secretsExporter.podSecurityContext | object | check `values.yaml` | PodSecurityContext for Pods of the TLS Secrets exporter |
383383
| secretsExporter.securityContext | object | check `values.yaml` | SecurityContext for containers of the TLS Secrets exporter |
384384
| secretsExporter.extraVolumes | list | `[]` | Additionnal volumes added to Pods of the TLS Secrets exporter (combined with global `extraVolumes`) |
385385
| secretsExporter.extraVolumeMounts | list | `[]` | Additionnal volume mounts added to Pod containers of the TLS Secrets exporter (combined with global `extraVolumeMounts`) |
@@ -390,6 +390,9 @@ hostPathsExporter:
390390
| secretsExporter.excludeLabels | list | `[]` | Exclude TLS Secrets having these labels. Items can be keys such as `my-label` or also require a value with syntax `my-label=my-value`. |
391391
| secretsExporter.cache.enabled | bool | `true` | Enable caching of Kubernetes objects to prevent scraping timeouts |
392392
| secretsExporter.cache.maxDuration | int | `300` | Maximum time an object can stay in cache unrefreshed (seconds) - it will be at least half of that |
393+
| secretsExporter.kubeApiRateLimits.enabled | bool | `false` | Should requests to the Kubernetes API server be rate-limited |
394+
| secretsExporter.kubeApiRateLimits.queriesPerSecond | int | `5` | Maximum rate of queries sent to the API server (per second) |
395+
| secretsExporter.kubeApiRateLimits.burstQueries | int | `10` | Burst bucket size for queries sent to the API server |
393396
| secretsExporter.env | list | `[]` | Additional environment variables for container |
394397
| hostPathsExporter.debugMode | bool | `false` | Should debug messages be produced by hostPath exporters (default for all hostPathsExporter.daemonSets) |
395398
| hostPathsExporter.restartPolicy | string | `"Always"` | restartPolicy for Pods of hostPath exporters (default for all hostPathsExporter.daemonSets) |

deploy/charts/x509-certificate-exporter/templates/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ spec:
126126
- --max-cache-duration=0
127127
{{- end }}
128128
{{- with .Values.secretsExporter.kubeApiRateLimits }}
129-
- --kube-api-rate-limit-qps={{ .qps }}
130-
- --kube-api-rate-limit-burst={{ .burst }}
129+
{{- if .enabled }}
130+
- --kube-api-rate-limit-qps={{ int .queriesPerSecond }}
131+
- --kube-api-rate-limit-burst={{ int .burstQueries }}
132+
{{- end }}
131133
{{- end }}
132134
{{- if .Values.exposePerCertificateErrorMetrics }}
133135
- --expose-per-cert-error-metrics

deploy/charts/x509-certificate-exporter/values.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ secretsExporter:
9191
# -- Annotations added to Pods of the TLS Secrets exporter
9292
podAnnotations: {}
9393
# -- PodSecurityContext for Pods of the TLS Secrets exporter
94+
# @default -- check `values.yaml`
9495
podSecurityContext:
9596
runAsNonRoot: true
9697
# -- SecurityContext for containers of the TLS Secrets exporter
@@ -128,10 +129,13 @@ secretsExporter:
128129
# -- Maximum time an object can stay in cache unrefreshed (seconds) - it will be at least half of that
129130
maxDuration: 300
130131

131-
kubeApiRateLimits: {}
132-
# -- Try higher values if querying secrets takes a long time because of throttling
133-
# qps: 5
134-
# burst: 10
132+
kubeApiRateLimits:
133+
# -- Should requests to the Kubernetes API server be rate-limited
134+
enabled: false
135+
# -- Maximum rate of queries sent to the API server (per second)
136+
queriesPerSecond: 5
137+
# -- Burst bucket size for queries sent to the API server
138+
burstQueries: 10
135139

136140
# -- Additional environment variables for container
137141
env: []

0 commit comments

Comments
 (0)