From b391694e67dc0e63040d16b6002fc39e3faf40f9 Mon Sep 17 00:00:00 2001 From: Vishal Choudhary Date: Fri, 17 Nov 2023 20:29:40 +0530 Subject: [PATCH] feat: allow setting admission controller replica count to 2 (#8932) * feat: allow setting admission controller replica count to 2 Signed-off-by: Vishal Choudhary * feat: add warning for HA mode Signed-off-by: Vishal Choudhary --------- Signed-off-by: Vishal Choudhary Co-authored-by: treydock --- charts/kyverno/Chart.yaml | 2 ++ charts/kyverno/templates/NOTES.txt | 6 +++--- charts/kyverno/templates/validate.yaml | 6 ------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/charts/kyverno/Chart.yaml b/charts/kyverno/Chart.yaml index e278ce49b2..653d3c97e2 100644 --- a/charts/kyverno/Chart.yaml +++ b/charts/kyverno/Chart.yaml @@ -77,6 +77,8 @@ annotations: description: missing image pull policy missing in a couple of deployments - kind: added description: added TUF flags for custom sigstore deployments + - kind: added + description: allow setting admission controller replica count to 2 dependencies: - name: grafana version: "0.0.0" diff --git a/charts/kyverno/templates/NOTES.txt b/charts/kyverno/templates/NOTES.txt index 5eb551ec51..356e69e67a 100644 --- a/charts/kyverno/templates/NOTES.txt +++ b/charts/kyverno/templates/NOTES.txt @@ -22,9 +22,9 @@ The following components have been installed in your cluster: {{- end }} {{ if not .Values.admissionController.replicas }} -⚠️ WARNING: Setting the admission controller replica count below 3 means Kyverno is not running in high availability mode. -{{- else if lt (int .Values.admissionController.replicas) 3 }} -⚠️ WARNING: Setting the admission controller replica count below 3 means Kyverno is not running in high availability mode. +⚠️ WARNING: Setting the admission controller replica count below 2 means Kyverno is not running in high availability mode. +{{- else if lt (int .Values.admissionController.replicas) 2 }} +⚠️ WARNING: Setting the admission controller replica count below 2 means Kyverno is not running in high availability mode. {{- end }} {{- if semverCompare "<1.21.0" .Capabilities.KubeVersion.Version }} diff --git a/charts/kyverno/templates/validate.yaml b/charts/kyverno/templates/validate.yaml index fab8dd8de6..94469fba8d 100644 --- a/charts/kyverno/templates/validate.yaml +++ b/charts/kyverno/templates/validate.yaml @@ -2,12 +2,6 @@ {{- fail "mode is not supported anymore, please remove it from your release and use admissionController.replicas instead." -}} {{- end -}} -{{- if .Values.admissionController.replicas -}} - {{- if eq (int .Values.admissionController.replicas) 2 -}} - {{- fail "Kyverno does not support running with 2 replicas. For a highly-available deployment, select 3 replicas or for standalone select 1 replica." -}} - {{- end -}} -{{- end -}} - {{- if eq (include "kyverno.namespace" .) "kube-system" -}} {{- fail "Kyverno cannot be installed in namespace kube-system." -}} {{- end -}}