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:
parent
f330886af7
commit
1208e51b68
2 changed files with 15 additions and 15 deletions
|
@ -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 }}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue