From fe00185c288bd4624f0f5401a4e65a217136966f Mon Sep 17 00:00:00 2001 From: Matt Dainty Date: Wed, 15 Nov 2023 10:14:12 +0000 Subject: [PATCH] fix: Add chart parameters for setting revisionHistoryLimit Signed-off-by: Matt Dainty --- charts/kyverno/Chart.yaml | 2 ++ charts/kyverno/README.md | 4 ++++ .../templates/admission-controller/deployment.yaml | 1 + .../templates/background-controller/deployment.yaml | 1 + .../templates/cleanup-controller/deployment.yaml | 3 ++- .../templates/reports-controller/deployment.yaml | 1 + charts/kyverno/values.yaml | 12 ++++++++++++ config/install-latest-testing.yaml | 4 ++++ 8 files changed, 27 insertions(+), 1 deletion(-) diff --git a/charts/kyverno/Chart.yaml b/charts/kyverno/Chart.yaml index 61f709fd2e55..86b570d1415d 100644 --- a/charts/kyverno/Chart.yaml +++ b/charts/kyverno/Chart.yaml @@ -33,6 +33,8 @@ annotations: url: https://kyverno.io/docs # valid kinds are: added, changed, deprecated, removed, fixed and security artifacthub.io/changes: | + - kind: added + description: allow overriding revisionHistoryLimit - kind: added description: support for GrafanaDashboard custom resource - kind: changed diff --git a/charts/kyverno/README.md b/charts/kyverno/README.md index 22af2117c017..2f6f9c5de799 100644 --- a/charts/kyverno/README.md +++ b/charts/kyverno/README.md @@ -333,6 +333,7 @@ The chart values are organised per component. | admissionController.rbac.clusterRole.extraResources | list | `[]` | Extra resource permissions to add in the cluster role | | admissionController.createSelfSignedCert | bool | `false` | Create self-signed certificates at deployment time. The certificates won't be automatically renewed if this is set to `true`. | | admissionController.replicas | int | `nil` | Desired number of pods | +| admissionController.revisionHistoryLimit | int | `10` | The number of revisions to keep | | admissionController.podLabels | object | `{}` | Additional labels to add to each pod | | admissionController.podAnnotations | object | `{}` | Additional annotations to add to each pod | | admissionController.updateStrategy | object | See [values.yaml](values.yaml) | Deployment update strategy. Ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy | @@ -425,6 +426,7 @@ The chart values are organised per component. | backgroundController.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | backgroundController.imagePullSecrets | list | `[]` | Image pull secrets | | backgroundController.replicas | int | `nil` | Desired number of pods | +| backgroundController.revisionHistoryLimit | int | `10` | The number of revisions to keep | | backgroundController.podLabels | object | `{}` | Additional labels to add to each pod | | backgroundController.podAnnotations | object | `{}` | Additional annotations to add to each pod | | backgroundController.updateStrategy | object | See [values.yaml](values.yaml) | Deployment update strategy. Ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy | @@ -490,6 +492,7 @@ The chart values are organised per component. | cleanupController.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | cleanupController.imagePullSecrets | list | `[]` | Image pull secrets | | cleanupController.replicas | int | `nil` | Desired number of pods | +| cleanupController.revisionHistoryLimit | int | `10` | The number of revisions to keep | | cleanupController.podLabels | object | `{}` | Additional labels to add to each pod | | cleanupController.podAnnotations | object | `{}` | Additional annotations to add to each pod | | cleanupController.updateStrategy | object | See [values.yaml](values.yaml) | Deployment update strategy. Ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy | @@ -561,6 +564,7 @@ The chart values are organised per component. | reportsController.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | reportsController.imagePullSecrets | list | `[]` | Image pull secrets | | reportsController.replicas | int | `nil` | Desired number of pods | +| reportsController.revisionHistoryLimit | int | `10` | The number of revisions to keep | | reportsController.podLabels | object | `{}` | Additional labels to add to each pod | | reportsController.podAnnotations | object | `{}` | Additional annotations to add to each pod | | reportsController.updateStrategy | object | See [values.yaml](values.yaml) | Deployment update strategy. Ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy | diff --git a/charts/kyverno/templates/admission-controller/deployment.yaml b/charts/kyverno/templates/admission-controller/deployment.yaml index 42e3396ccfa7..6ba76191a4a7 100644 --- a/charts/kyverno/templates/admission-controller/deployment.yaml +++ b/charts/kyverno/templates/admission-controller/deployment.yaml @@ -8,6 +8,7 @@ metadata: {{- include "kyverno.admission-controller.labels" . | nindent 4 }} spec: replicas: {{ template "kyverno.deployment.replicas" .Values.admissionController.replicas }} + revisionHistoryLimit: {{ .Values.admissionController.revisionHistoryLimit }} {{- with .Values.admissionController.updateStrategy }} strategy: {{- toYaml . | nindent 4 }} diff --git a/charts/kyverno/templates/background-controller/deployment.yaml b/charts/kyverno/templates/background-controller/deployment.yaml index bb80f5f42fcd..c3453fce93f6 100644 --- a/charts/kyverno/templates/background-controller/deployment.yaml +++ b/charts/kyverno/templates/background-controller/deployment.yaml @@ -9,6 +9,7 @@ metadata: {{- include "kyverno.background-controller.labels" . | nindent 4 }} spec: replicas: {{ template "kyverno.deployment.replicas" .Values.backgroundController.replicas }} + revisionHistoryLimit: {{ .Values.backgroundController.revisionHistoryLimit }} {{- with .Values.backgroundController.updateStrategy }} strategy: {{- toYaml . | nindent 4 }} diff --git a/charts/kyverno/templates/cleanup-controller/deployment.yaml b/charts/kyverno/templates/cleanup-controller/deployment.yaml index 5f2a3d587b15..cdfa4cd50715 100644 --- a/charts/kyverno/templates/cleanup-controller/deployment.yaml +++ b/charts/kyverno/templates/cleanup-controller/deployment.yaml @@ -9,6 +9,7 @@ metadata: {{- include "kyverno.cleanup-controller.labels" . | nindent 4 }} spec: replicas: {{ template "kyverno.deployment.replicas" .Values.cleanupController.replicas }} + revisionHistoryLimit: {{ .Values.cleanupController.revisionHistoryLimit }} {{- with .Values.cleanupController.updateStrategy }} strategy: {{- toYaml . | nindent 4 }} @@ -162,4 +163,4 @@ spec: {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/kyverno/templates/reports-controller/deployment.yaml b/charts/kyverno/templates/reports-controller/deployment.yaml index cdaa8c0dbc01..cf4f5d9f4704 100644 --- a/charts/kyverno/templates/reports-controller/deployment.yaml +++ b/charts/kyverno/templates/reports-controller/deployment.yaml @@ -9,6 +9,7 @@ metadata: {{- include "kyverno.reports-controller.labels" . | nindent 4 }} spec: replicas: {{ template "kyverno.deployment.replicas" .Values.reportsController.replicas }} + revisionHistoryLimit: {{ .Values.reportsController.revisionHistoryLimit }} {{- with .Values.reportsController.updateStrategy }} strategy: {{- toYaml . | nindent 4 }} diff --git a/charts/kyverno/values.yaml b/charts/kyverno/values.yaml index 8f6935b26417..78c9824f0571 100644 --- a/charts/kyverno/values.yaml +++ b/charts/kyverno/values.yaml @@ -667,6 +667,9 @@ admissionController: # -- (int) Desired number of pods replicas: ~ + # -- The number of revisions to keep + revisionHistoryLimit: 10 + # -- Additional labels to add to each pod podLabels: {} # example.com/label: foo @@ -1084,6 +1087,9 @@ backgroundController: # -- (int) Desired number of pods replicas: ~ + # -- The number of revisions to keep + revisionHistoryLimit: 10 + # -- Additional labels to add to each pod podLabels: {} # example.com/label: foo @@ -1309,6 +1315,9 @@ cleanupController: # -- (int) Desired number of pods replicas: ~ + # -- The number of revisions to keep + revisionHistoryLimit: 10 + # -- Additional labels to add to each pod podLabels: {} # example.com/label: foo @@ -1580,6 +1589,9 @@ reportsController: # -- (int) Desired number of pods replicas: ~ + # -- The number of revisions to keep + revisionHistoryLimit: 10 + # -- Additional labels to add to each pod podLabels: {} # example.com/label: foo diff --git a/config/install-latest-testing.yaml b/config/install-latest-testing.yaml index dd54f71b63fb..c5625fe740c4 100644 --- a/config/install-latest-testing.yaml +++ b/config/install-latest-testing.yaml @@ -45440,6 +45440,7 @@ metadata: app.kubernetes.io/version: latest spec: replicas: + revisionHistoryLimit: 10 strategy: rollingUpdate: maxSurge: 1 @@ -45631,6 +45632,7 @@ metadata: app.kubernetes.io/version: latest spec: replicas: + revisionHistoryLimit: 10 strategy: rollingUpdate: maxSurge: 1 @@ -45729,6 +45731,7 @@ metadata: app.kubernetes.io/version: latest spec: replicas: + revisionHistoryLimit: 10 strategy: rollingUpdate: maxSurge: 1 @@ -45860,6 +45863,7 @@ metadata: app.kubernetes.io/version: latest spec: replicas: + revisionHistoryLimit: 10 strategy: rollingUpdate: maxSurge: 1