diff --git a/charts/kyverno/README.md b/charts/kyverno/README.md index b99188b3f1..89027acceb 100644 --- a/charts/kyverno/README.md +++ b/charts/kyverno/README.md @@ -295,6 +295,7 @@ The chart values are organised per component. | features.forceFailurePolicyIgnore.enabled | bool | `false` | Enables the feature | | features.logging.format | string | `"text"` | Logging format | | features.logging.verbosity | int | `2` | Logging verbosity | +| features.omitEvents.eventTypes | list | `[]` | Events which should not be emitted (possible values `PolicyViolation`, `PolicyApplied`, `PolicyError`, and `PolicySkipped`) | | features.policyExceptions.enabled | bool | `false` | Enables the feature | | features.policyExceptions.namespace | string | `""` | Restrict policy exceptions to a single namespace | | features.protectManagedResources.enabled | bool | `false` | Enables the feature | diff --git a/charts/kyverno/templates/_helpers.tpl b/charts/kyverno/templates/_helpers.tpl index a45367d942..e98df2411b 100644 --- a/charts/kyverno/templates/_helpers.tpl +++ b/charts/kyverno/templates/_helpers.tpl @@ -35,9 +35,16 @@ {{- $flags = append $flags (print "--loggingFormat=" .format) -}} {{- $flags = append $flags (print "--v=" (join "," .verbosity)) -}} {{- end -}} +{{- with .omitEvents -}} + {{- with .eventTypes -}} + {{- $flags = append $flags (print "--omit-events=" (join "," .)) -}} + {{- end -}} +{{- end -}} {{- with .policyExceptions -}} {{- $flags = append $flags (print "--enablePolicyException=" .enabled) -}} - {{- $flags = append $flags (print "--exceptionNamespace=" .namespace) -}} + {{- with .namespace -}} + {{- $flags = append $flags (print "--exceptionNamespace=" .) -}} + {{- end -}} {{- end -}} {{- with .protectManagedResources -}} {{- $flags = append $flags (print "--protectManagedResources=" .enabled) -}} diff --git a/charts/kyverno/templates/admission-controller/deployment.yaml b/charts/kyverno/templates/admission-controller/deployment.yaml index 621d03f71f..cb1a7e429c 100644 --- a/charts/kyverno/templates/admission-controller/deployment.yaml +++ b/charts/kyverno/templates/admission-controller/deployment.yaml @@ -152,6 +152,7 @@ spec: "dumpPayload" "forceFailurePolicyIgnore" "logging" + "omitEvents" "policyExceptions" "protectManagedResources" "registryClient" diff --git a/charts/kyverno/templates/background-controller/deployment.yaml b/charts/kyverno/templates/background-controller/deployment.yaml index c18262c8b3..fa2d945711 100644 --- a/charts/kyverno/templates/background-controller/deployment.yaml +++ b/charts/kyverno/templates/background-controller/deployment.yaml @@ -104,6 +104,7 @@ spec: {{- include "kyverno.features.flags" (pick (mergeOverwrite .Values.features .Values.backgroundController.featuresOverride) "configMapCaching" "logging" + "omitEvents" "policyExceptions" ) | nindent 12 }} {{- range $key, $value := .Values.backgroundController.extraArgs }} diff --git a/charts/kyverno/templates/reports-controller/deployment.yaml b/charts/kyverno/templates/reports-controller/deployment.yaml index d2042cf170..36cc3d0380 100644 --- a/charts/kyverno/templates/reports-controller/deployment.yaml +++ b/charts/kyverno/templates/reports-controller/deployment.yaml @@ -106,6 +106,7 @@ spec: "backgroundScan" "configMapCaching" "logging" + "omitEvents" "policyExceptions" "reports" "registryClient" diff --git a/charts/kyverno/values.yaml b/charts/kyverno/values.yaml index ad91c52430..2ee1650a9a 100644 --- a/charts/kyverno/values.yaml +++ b/charts/kyverno/values.yaml @@ -354,6 +354,13 @@ features: format: text # -- Logging verbosity verbosity: 2 + omitEvents: + # -- Events which should not be emitted (possible values `PolicyViolation`, `PolicyApplied`, `PolicyError`, and `PolicySkipped`) + eventTypes: [] + # - PolicyViolation + # - PolicyApplied + # - PolicyError + # - PolicySkipped policyExceptions: # -- Enables the feature enabled: false diff --git a/config/install-latest-testing.yaml b/config/install-latest-testing.yaml index 1a731d7506..e219b3736e 100644 --- a/config/install-latest-testing.yaml +++ b/config/install-latest-testing.yaml @@ -35297,7 +35297,6 @@ spec: - --loggingFormat=text - --v=2 - --enablePolicyException=false - - --exceptionNamespace= - --protectManagedResources=false - --allowInsecureRegistry=false - --registryCredentialHelpers=default,google,amazon,azure,github @@ -35442,7 +35441,6 @@ spec: - --loggingFormat=text - --v=2 - --enablePolicyException=false - - --exceptionNamespace= env: - name: METRICS_CONFIG value: kyverno-metrics @@ -35660,7 +35658,6 @@ spec: - --loggingFormat=text - --v=2 - --enablePolicyException=false - - --exceptionNamespace= - --reportsChunkSize=1000 - --allowInsecureRegistry=false - --registryCredentialHelpers=default,google,amazon,azure,github