1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-05 07:26:55 +00:00

refactor: helm admission controller replicas (#6453)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-03-02 13:01:06 +01:00 committed by GitHub
parent 53f7a3ff96
commit 0dfa053462
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 11 deletions

View file

@ -121,6 +121,7 @@ In `v3` chart values changed significantly, please read the instructions below t
- `testImage` has been replaced with `test.image`
- `testResources` has been replaced with `test.resources`
- `testSecurityContext` has been replaced with `test.securityContext`
- `replicaCount` has been replaced with `admissionController.replicas`
- Labels and selectors have been reworked and due to immutability, upgrading from `v2` to `v3` is going to be rejected. The easiest solution is to uninstall `v2` and reinstall `v3` once values have been adapted to the changes described above.
@ -187,7 +188,6 @@ The command removes all the Kubernetes components associated with the chart and
| initImage.tag | string | `nil` | Image tag If initImage.tag is missing, defaults to image.tag |
| initImage.pullPolicy | string | `nil` | Image pull policy If initImage.pullPolicy is missing, defaults to image.pullPolicy |
| initContainer.extraArgs | list | `["--loggingFormat=text"]` | Extra arguments to give to the kyvernopre binary. |
| replicaCount | int | `nil` | Desired number of pods |
| podLabels | object | `{}` | Additional labels to add to each pod |
| podAnnotations | object | `{}` | Additional annotations to add to each pod |
| podSecurityContext | object | `{}` | Security context for the pod |
@ -247,6 +247,7 @@ The command removes all the Kubernetes components associated with the chart and
| grafana.configMapName | string | `"{{ include \"kyverno.fullname\" . }}-grafana"` | Configmap name template. |
| grafana.namespace | string | `nil` | Namespace to create the grafana dashboard configmap. If not set, it will be created in the same namespace where the chart is deployed. |
| grafana.annotations | object | `{}` | Grafana dashboard configmap annotations. |
| admissionController.replicas | int | `nil` | Desired number of pods |
| cleanupController.enabled | bool | `true` | Enable cleanup controller. |
| cleanupController.rbac.create | bool | `true` | Create RBAC resources |
| cleanupController.rbac.serviceAccount.name | string | `nil` | Service account name |

View file

@ -121,6 +121,7 @@ In `v3` chart values changed significantly, please read the instructions below t
- `testImage` has been replaced with `test.image`
- `testResources` has been replaced with `test.resources`
- `testSecurityContext` has been replaced with `test.securityContext`
- `replicaCount` has been replaced with `admissionController.replicas`
- Labels and selectors have been reworked and due to immutability, upgrading from `v2` to `v3` is going to be rejected. The easiest solution is to uninstall `v2` and reinstall `v3` once values have been adapted to the changes described above.

View file

@ -21,9 +21,9 @@ The following components have been installed in your cluster:
- Grafana dashboard
{{- end }}
{{ if not .Values.replicaCount }}
{{ if not .Values.admissionController.replicas }}
⚠️ WARNING: Setting replicas count below 3 means Kyverno is not running in high availability mode.
{{- else if lt (int .Values.replicaCount) 3 }}
{{- else if lt (int .Values.admissionController.replicas) 3 }}
⚠️ WARNING: Setting replicas count below 3 means Kyverno is not running in high availability mode.
{{- end }}

View file

@ -7,7 +7,7 @@ metadata:
labels:
{{- include "kyverno.admission-controller.labels" . | nindent 4 }}
spec:
replicas: {{ template "kyverno.deployment.replicas" .Values.replicaCount }}
replicas: {{ template "kyverno.deployment.replicas" .Values.admissionController.replicas }}
selector:
matchLabels:
{{- include "kyverno.admission-controller.matchLabels" . | nindent 6 }}

View file

@ -1,4 +1,4 @@
{{- if (gt (int .Values.replicaCount) 1) -}}
{{- if (gt (int .Values.admissionController.replicas) 1) -}}
apiVersion: {{ template "kyverno.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:

View file

@ -1,9 +1,9 @@
{{- if hasKey .Values "mode" }}
{{ fail "mode is not supported anymore, please remove it from your release and use replicaCount instead." }}
{{ fail "mode is not supported anymore, please remove it from your release and use admissionController.replicas instead." }}
{{- end }}
{{- if .Values.replicaCount }}
{{- if eq (int .Values.replicaCount) 2 }}
{{- 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 }}

View file

@ -234,9 +234,6 @@ initContainer:
extraArgs:
- --loggingFormat=text
# -- (int) Desired number of pods
replicaCount: ~
# -- Additional labels to add to each pod
podLabels: {}
# example.com/label: foo
@ -511,6 +508,12 @@ grafana:
# -- Grafana dashboard configmap annotations.
annotations: {}
# Admission controller configuration
admissionController:
# -- (int) Desired number of pods
replicas: ~
# Cleanup controller configuration
cleanupController: