helm: add soft-affinity rules for worker and web

This commit is contained in:
Jens Langhammer 2020-09-14 00:12:40 +02:00
parent 810f10edfe
commit 69eecd6b60
2 changed files with 36 additions and 0 deletions

View File

@ -22,6 +22,24 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
k8s.passbook.beryju.org/component: web k8s.passbook.beryju.org/component: web
spec: spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "passbook.name" . }}
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
- key: k8s.passbook.beryju.org/component
operator: In
values:
- web
topologyKey: "kubernetes.io/hostname"
initContainers: initContainers:
- name: passbook-database-migrations - name: passbook-database-migrations
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"

View File

@ -22,6 +22,24 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
k8s.passbook.beryju.org/component: worker k8s.passbook.beryju.org/component: worker
spec: spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "passbook.name" . }}
- key: app.kubernetes.io/instance
operator: In
values:
- {{ .Release.Name }}
- key: k8s.passbook.beryju.org/component
operator: In
values:
- worker
topologyKey: "kubernetes.io/hostname"
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"