From a747418c9062b8d52f9be315a4d7a566a54b88b9 Mon Sep 17 00:00:00 2001 From: Frank Jogeleit Date: Thu, 30 Nov 2023 09:55:30 +0100 Subject: [PATCH] resources config for CronJobs (#374) Signed-off-by: Frank Jogeleit --- CHANGELOG.md | 4 +++- Makefile | 2 +- charts/policy-reporter/Chart.yaml | 4 ++-- charts/policy-reporter/README.md | 2 +- .../templates/cronjob-summary-report.yaml | 2 ++ .../templates/cronjob-violations-report.yaml | 2 ++ charts/policy-reporter/values.yaml | 9 ++++++++- manifest/policy-reporter-kyverno-ui-ha/install.yaml | 2 +- manifest/policy-reporter-kyverno-ui/install.yaml | 2 +- manifest/policy-reporter-ui/install.yaml | 2 +- manifest/policy-reporter/install.yaml | 2 +- manifest/violations-email-report/cronjob.yaml | 2 +- 12 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c6dc197..53782b57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ # Changelog -# Next +# 2.21.3 * Policy Reporter v2.17.4 * Fix Result Resource mapping * Policy Reporter v2.17.3 * Fix handling if metric cache fallback +* Helm Chart + * Configure `resources` for email report CronJobs via `emailReports.resources` # 2.21.2 * Policy Reporter v2.17.2 diff --git a/Makefile b/Makefile index 2fa08253..1da15014 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ GO ?= go BUILD ?= build REPO ?= ghcr.io/kyverno/policy-reporter -IMAGE_TAG ?= 2.17.2 +IMAGE_TAG ?= 2.17.4 LD_FLAGS=-s -w -linkmode external -extldflags "-static" PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x diff --git a/charts/policy-reporter/Chart.yaml b/charts/policy-reporter/Chart.yaml index 77735a20..cc105e87 100644 --- a/charts/policy-reporter/Chart.yaml +++ b/charts/policy-reporter/Chart.yaml @@ -5,8 +5,8 @@ description: | It creates Prometheus Metrics and can send rule validation events to different targets like Loki, Elasticsearch, Slack or Discord type: application -version: 2.21.2 -appVersion: 2.17.2 +version: 2.21.3 +appVersion: 2.17.4 icon: https://github.com/kyverno/kyverno/raw/main/img/logo.png home: https://kyverno.github.io/policy-reporter diff --git a/charts/policy-reporter/README.md b/charts/policy-reporter/README.md index 07d4e058..5e407d4d 100644 --- a/charts/policy-reporter/README.md +++ b/charts/policy-reporter/README.md @@ -1,6 +1,6 @@ # Policy Reporter -![Version: v2.21.2](https://img.shields.io/badge/Version-v2.21.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.17.2](https://img.shields.io/badge/AppVersion-v2.17.2-informational?style=flat-square) +![Version: v2.21.3](https://img.shields.io/badge/Version-v2.21.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.17.4](https://img.shields.io/badge/AppVersion-v2.17.4-informational?style=flat-square) ## Motivation diff --git a/charts/policy-reporter/templates/cronjob-summary-report.yaml b/charts/policy-reporter/templates/cronjob-summary-report.yaml index f9aeb07d..9083c27e 100644 --- a/charts/policy-reporter/templates/cronjob-summary-report.yaml +++ b/charts/policy-reporter/templates/cronjob-summary-report.yaml @@ -108,6 +108,8 @@ spec: key: encryption optional: true {{- end }} + resources: + {{- toYaml .Values.emailReports.resources | nindent 16 }} volumes: - name: config-file secret: diff --git a/charts/policy-reporter/templates/cronjob-violations-report.yaml b/charts/policy-reporter/templates/cronjob-violations-report.yaml index b9b80051..f2dc6f0c 100644 --- a/charts/policy-reporter/templates/cronjob-violations-report.yaml +++ b/charts/policy-reporter/templates/cronjob-violations-report.yaml @@ -108,6 +108,8 @@ spec: key: encryption optional: true {{- end }} + resources: + {{- toYaml .Values.emailReports.resources | nindent 16 }} volumes: - name: config-file secret: diff --git a/charts/policy-reporter/values.yaml b/charts/policy-reporter/values.yaml index 3d81f2cf..762d4fc0 100644 --- a/charts/policy-reporter/values.yaml +++ b/charts/policy-reporter/values.yaml @@ -5,7 +5,7 @@ image: registry: ghcr.io repository: kyverno/policy-reporter pullPolicy: IfNotPresent - tag: 2.17.2 + tag: 2.17.4 imagePullSecrets: [] @@ -283,6 +283,13 @@ emailReports: # include: ['team-a-*'] # sources: # include: ['Kyverno'] + resources: {} + # limits: + # memory: 100Mi + # cpu: 10m + # requests: + # memory: 75Mi + # cpu: 5m # Reference a configuration which already exists instead of creating one existingTargetConfig: diff --git a/manifest/policy-reporter-kyverno-ui-ha/install.yaml b/manifest/policy-reporter-kyverno-ui-ha/install.yaml index 71ded288..f6fbbd0e 100644 --- a/manifest/policy-reporter-kyverno-ui-ha/install.yaml +++ b/manifest/policy-reporter-kyverno-ui-ha/install.yaml @@ -480,7 +480,7 @@ spec: fsGroup: 1234 containers: - name: policy-reporter - image: "ghcr.io/kyverno/policy-reporter:2.17.2" + image: "ghcr.io/kyverno/policy-reporter:2.17.4" imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false diff --git a/manifest/policy-reporter-kyverno-ui/install.yaml b/manifest/policy-reporter-kyverno-ui/install.yaml index 5436938f..5dd83d1a 100644 --- a/manifest/policy-reporter-kyverno-ui/install.yaml +++ b/manifest/policy-reporter-kyverno-ui/install.yaml @@ -367,7 +367,7 @@ spec: fsGroup: 1234 containers: - name: policy-reporter - image: "ghcr.io/kyverno/policy-reporter:2.17.2" + image: "ghcr.io/kyverno/policy-reporter:2.17.4" imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false diff --git a/manifest/policy-reporter-ui/install.yaml b/manifest/policy-reporter-ui/install.yaml index a9e60d5e..dca790fd 100644 --- a/manifest/policy-reporter-ui/install.yaml +++ b/manifest/policy-reporter-ui/install.yaml @@ -223,7 +223,7 @@ spec: fsGroup: 1234 containers: - name: policy-reporter - image: "ghcr.io/kyverno/policy-reporter:2.17.2" + image: "ghcr.io/kyverno/policy-reporter:2.17.4" imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false diff --git a/manifest/policy-reporter/install.yaml b/manifest/policy-reporter/install.yaml index 1bef7336..6a32e729 100644 --- a/manifest/policy-reporter/install.yaml +++ b/manifest/policy-reporter/install.yaml @@ -113,7 +113,7 @@ spec: automountServiceAccountToken: true containers: - name: policy-reporter - image: "ghcr.io/kyverno/policy-reporter:2.17.2" + image: "ghcr.io/kyverno/policy-reporter:2.17.4" imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false diff --git a/manifest/violations-email-report/cronjob.yaml b/manifest/violations-email-report/cronjob.yaml index 76a1899a..ffcbab49 100644 --- a/manifest/violations-email-report/cronjob.yaml +++ b/manifest/violations-email-report/cronjob.yaml @@ -26,7 +26,7 @@ spec: restartPolicy: Never containers: - name: policy-reporter - image: "ghcr.io/kyverno/policy-reporter:2.17.2" + image: "ghcr.io/kyverno/policy-reporter:2.17.4" imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false