Skip to content

Commit

Permalink
feat: allow setting admission controller replica count to 2 (kyverno#…
Browse files Browse the repository at this point in the history
…8932)

* feat: allow setting admission controller replica count to 2

Signed-off-by: Vishal Choudhary <[email protected]>

* feat: add warning for HA mode

Signed-off-by: Vishal Choudhary <[email protected]>

---------

Signed-off-by: Vishal Choudhary <[email protected]>
Co-authored-by: treydock <[email protected]>
  • Loading branch information
vishal-chdhry and treydock authored Nov 17, 2023
1 parent d8c2c58 commit b391694
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 2 additions & 0 deletions charts/kyverno/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions charts/kyverno/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 0 additions & 6 deletions charts/kyverno/templates/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down

0 comments on commit b391694

Please sign in to comment.