Skip to content

Commit

Permalink
Feat: need podAntiAffinity for vela pods, in order to make kubevela h…
Browse files Browse the repository at this point in the history
…igh availability (kubevela#5465)

Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
  • Loading branch information
StevenLeiZhang authored and zhaohuiweixiao committed Mar 7, 2023
1 parent f307dc0 commit c1c4936
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 12 deletions.
15 changes: 12 additions & 3 deletions charts/vela-core/templates/cluster-gateway/cluster-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,19 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.affinity }}
{{- toYaml .Values.affinity | nindent 8 }}
{{ else }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
{{- include "kubevela-cluster-gateway.selectorLabels" . | nindent 20 }}
topologyKey: kubernetes.io/hostname
weight: 100
{{ end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
15 changes: 12 additions & 3 deletions charts/vela-core/templates/kubevela-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,19 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.affinity }}
{{- toYaml .Values.affinity | nindent 8 }}
{{ else }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
{{- include "kubevela.selectorLabels" . | nindent 20 }}
topologyKey: kubernetes.io/hostname
weight: 100
{{ end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
15 changes: 12 additions & 3 deletions charts/vela-minimal/templates/cluster-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,19 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.affinity }}
{{- toYaml .Values.affinity | nindent 8 }}
{{ else }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
{{- include "kubevela-cluster-gateway.selectorLabels" . | nindent 20 }}
topologyKey: kubernetes.io/hostname
weight: 100
{{ end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
15 changes: 12 additions & 3 deletions charts/vela-minimal/templates/kubevela-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,19 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ if .Values.affinity }}
{{- toYaml .Values.affinity | nindent 8 }}
{{ else }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
{{- include "kubevela.selectorLabels" . | nindent 20 }}
topologyKey: kubernetes.io/hostname
weight: 100
{{ end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down

0 comments on commit c1c4936

Please sign in to comment.