wildduck: Make sure Haraka, Wildduck and ZoneMTA are scheduled on same hosts for MetalLB

This commit is contained in:
Lauri Võsandi 2023-09-17 10:21:47 +03:00
parent 13a2430e9d
commit 3f5b90a546
3 changed files with 71 additions and 3 deletions

View File

@ -105,7 +105,7 @@ kind: Deployment
metadata: metadata:
name: haraka name: haraka
spec: spec:
replicas: 4 replicas: 2
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: wildduck app.kubernetes.io/name: wildduck
@ -116,6 +116,33 @@ spec:
app.kubernetes.io/name: wildduck app.kubernetes.io/name: wildduck
app.kubernetes.io/component: haraka app.kubernetes.io/component: haraka
spec: spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- wildduck
- key: app.kubernetes.io/component
operator: In
values:
- haraka
topologyKey: topology.kubernetes.io/zone
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- wildduck
- key: app.kubernetes.io/component
operator: In
values:
- wildduck
topologyKey: kubernetes.io/hostname
containers: containers:
- name: haraka - name: haraka
image: docker.io/codemowers/wildduck-haraka-inbound:latest@sha256:a130cc6a60ab2a47cb5971355ed2474136254613b4b8bd30aeabc6e123695ea3 image: docker.io/codemowers/wildduck-haraka-inbound:latest@sha256:a130cc6a60ab2a47cb5971355ed2474136254613b4b8bd30aeabc6e123695ea3

View File

@ -24,7 +24,7 @@ kind: Deployment
metadata: metadata:
name: wildduck name: wildduck
spec: spec:
replicas: 4 replicas: 2
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: wildduck app.kubernetes.io/name: wildduck
@ -35,6 +35,20 @@ spec:
app.kubernetes.io/name: wildduck app.kubernetes.io/name: wildduck
app.kubernetes.io/component: wildduck app.kubernetes.io/component: wildduck
spec: spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- wildduck
- key: app.kubernetes.io/component
operator: In
values:
- wildduck
topologyKey: topology.kubernetes.io/zone
containers: containers:
- name: wildduck - name: wildduck
image: docker.io/nodemailer/wildduck image: docker.io/nodemailer/wildduck

View File

@ -42,7 +42,7 @@ kind: Deployment
metadata: metadata:
name: zonemta name: zonemta
spec: spec:
replicas: 4 replicas: 2
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: wildduck app.kubernetes.io/name: wildduck
@ -53,6 +53,33 @@ spec:
app.kubernetes.io/name: wildduck app.kubernetes.io/name: wildduck
app.kubernetes.io/component: zonemta app.kubernetes.io/component: zonemta
spec: spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- wildduck
- key: app.kubernetes.io/component
operator: In
values:
- zonemta
topologyKey: topology.kubernetes.io/zone
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- wildduck
- key: app.kubernetes.io/component
operator: In
values:
- wildduck
topologyKey: kubernetes.io/hostname
containers: containers:
- name: zonemta - name: zonemta
image: docker.io/codemowers/wildduck-zonemta-outbound:latest@sha256:0878c803164e636820398f11a3811f3d92b7771c6202cfe229f97449d0009119 image: docker.io/codemowers/wildduck-zonemta-outbound:latest@sha256:0878c803164e636820398f11a3811f3d92b7771c6202cfe229f97449d0009119