1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 10:04:25 +00:00

Manage affinity with Helm values (#2900)

Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>

Co-authored-by: shuting <shutting06@gmail.com>
This commit is contained in:
Frank Jogeleit 2022-01-06 06:05:15 +01:00 committed by GitHub
parent f330886af7
commit 1208e51b68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 15 deletions

View file

@ -30,19 +30,9 @@ spec:
{{- with .Values.podSecurityContext }}
securityContext: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- if .Values.antiAffinity.enable }}
{{- if and .Values.antiAffinity.enable .Values.affinity }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- kyverno
topologyKey: {{ .Values.antiAffinity.topologyKey }}
{{- toYaml .Values.affinity | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }}

View file

@ -51,9 +51,19 @@ priorityClassName: ""
antiAffinity:
# This can be disabled in a 1 node cluster.
enable: true
# By default this will make sure two pods don't end up on the same node
# Changing this to a region would allow you to spread pods across regions
topologyKey: "kubernetes.io/hostname"
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- kyverno
topologyKey: kubernetes.io/hostname
podDisruptionBudget:
minAvailable: 1