Skip to content

Commit

Permalink
feat: add updateRequestThreshold config option to kyverno helm chart (k…
Browse files Browse the repository at this point in the history
…yverno#10739)

Signed-off-by: Garry O'Donnell <garry.o'[email protected]>
Co-authored-by: shuting <[email protected]>
Co-authored-by: Mariam Fahmy <[email protected]>
  • Loading branch information
3 people authored Aug 15, 2024
1 parent 3c63152 commit 5a60836
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/kyverno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ The chart values are organised per component.
| config.excludeClusterRoles | list | `[]` | Exclude roles |
| config.generateSuccessEvents | bool | `false` | Generate success events. |
| config.resourceFilters | list | See [values.yaml](values.yaml) | Resource types to be skipped by the Kyverno policy engine. Make sure to surround each entry in quotes so that it doesn't get parsed as a nested YAML list. These are joined together without spaces, run through `tpl`, and the result is set in the config map. |
| config.updateRequestThreshold | int | `1000` | Sets the threshold for the total number of UpdateRequests generated for mutateExisitng and generate policies. |
| config.webhooks | list | `[{"namespaceSelector":{"matchExpressions":[{"key":"kubernetes.io/metadata.name","operator":"NotIn","values":["kube-system"]}]}}]` | Defines the `namespaceSelector` in the webhook configurations. Note that it takes a list of `namespaceSelector` and/or `objectSelector` in the JSON format, and only the first element will be forwarded to the webhook configurations. The Kyverno namespace is excluded if `excludeKyvernoNamespace` is `true` (default) |
| config.webhookAnnotations | object | `{"admissions.enforcer/disabled":"true"}` | Defines annotations to set on webhook configurations. |
| config.webhookLabels | object | `{}` | Defines labels to set on webhook configurations. |
Expand Down
3 changes: 3 additions & 0 deletions charts/kyverno/templates/config/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ data:
resourceFilters: >-
{{- include "kyverno.config.resourceFilters" . | trim | nindent 4 }}
{{- end -}}
{{- with .Values.config.updateRequestThreshold }}
updateRequestThreshold: {{ . | quote }}
{{- end -}}
{{- if and .Values.config.webhooks .Values.config.excludeKyvernoNamespace }}
webhooks: {{ include "kyverno.config.webhooks" . | quote }}
{{- else if .Values.config.webhooks }}
Expand Down
3 changes: 3 additions & 0 deletions charts/kyverno/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ config:
- '[Secret,{{ include "kyverno.namespace" . }},{{ template "kyverno.admission-controller.serviceName" . }}.{{ template "kyverno.namespace" . }}.svc.*]'
- '[Secret,{{ include "kyverno.namespace" . }},{{ template "kyverno.cleanup-controller.name" . }}.{{ template "kyverno.namespace" . }}.svc.*]'

# -- Sets the threshold for the total number of UpdateRequests generated for mutateExisitng and generate policies.
updateRequestThreshold: 1000

# -- Defines the `namespaceSelector` in the webhook configurations.
# Note that it takes a list of `namespaceSelector` and/or `objectSelector` in the JSON format, and only the first element
# will be forwarded to the webhook configurations.
Expand Down
1 change: 1 addition & 0 deletions config/install-latest-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ data:
[ServiceMonitor,kyverno,kyverno-reports-controller]
[Secret,kyverno,kyverno-svc.kyverno.svc.*]
[Secret,kyverno,kyverno-cleanup-controller.kyverno.svc.*]
updateRequestThreshold: "1000"
webhooks: "[{\"namespaceSelector\":{\"matchExpressions\":[{\"key\":\"kubernetes.io/metadata.name\",\"operator\":\"NotIn\",\"values\":[\"kube-system\"]},{\"key\":\"kubernetes.io/metadata.name\",\"operator\":\"NotIn\",\"values\":[\"kyverno\"]}],\"matchLabels\":null}}]"
webhookAnnotations: "{\"admissions.enforcer/disabled\":\"true\"}"
---
Expand Down

0 comments on commit 5a60836

Please sign in to comment.