From 3f5b90a546346e9a9fe20a14afaf94effe07799e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Sun, 17 Sep 2023 10:21:47 +0300 Subject: [PATCH] wildduck: Make sure Haraka, Wildduck and ZoneMTA are scheduled on same hosts for MetalLB --- wildduck/haraka.yaml | 29 ++++++++++++++++++++++++++++- wildduck/wildduck.yaml | 16 +++++++++++++++- wildduck/zonemta.yaml | 29 ++++++++++++++++++++++++++++- 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/wildduck/haraka.yaml b/wildduck/haraka.yaml index 7455ef8..0264773 100644 --- a/wildduck/haraka.yaml +++ b/wildduck/haraka.yaml @@ -105,7 +105,7 @@ kind: Deployment metadata: name: haraka spec: - replicas: 4 + replicas: 2 selector: matchLabels: app.kubernetes.io/name: wildduck @@ -116,6 +116,33 @@ spec: app.kubernetes.io/name: wildduck app.kubernetes.io/component: haraka 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: - name: haraka image: docker.io/codemowers/wildduck-haraka-inbound:latest@sha256:a130cc6a60ab2a47cb5971355ed2474136254613b4b8bd30aeabc6e123695ea3 diff --git a/wildduck/wildduck.yaml b/wildduck/wildduck.yaml index 34f191e..4dbbd83 100644 --- a/wildduck/wildduck.yaml +++ b/wildduck/wildduck.yaml @@ -24,7 +24,7 @@ kind: Deployment metadata: name: wildduck spec: - replicas: 4 + replicas: 2 selector: matchLabels: app.kubernetes.io/name: wildduck @@ -35,6 +35,20 @@ spec: app.kubernetes.io/name: wildduck app.kubernetes.io/component: wildduck 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: - name: wildduck image: docker.io/nodemailer/wildduck diff --git a/wildduck/zonemta.yaml b/wildduck/zonemta.yaml index 70f9951..7bee65d 100644 --- a/wildduck/zonemta.yaml +++ b/wildduck/zonemta.yaml @@ -42,7 +42,7 @@ kind: Deployment metadata: name: zonemta spec: - replicas: 4 + replicas: 2 selector: matchLabels: app.kubernetes.io/name: wildduck @@ -53,6 +53,33 @@ spec: app.kubernetes.io/name: wildduck app.kubernetes.io/component: zonemta 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: - name: zonemta image: docker.io/codemowers/wildduck-zonemta-outbound:latest@sha256:0878c803164e636820398f11a3811f3d92b7771c6202cfe229f97449d0009119