From 2c0a355a7f6a6895d131a1d62bb47a2cb7a0f5c3 Mon Sep 17 00:00:00 2001 From: Tom Neuber Date: Mon, 25 Nov 2024 06:01:04 +0100 Subject: [PATCH] fix(thanos): add pod antiaffinity for receivers to avoid scheduling on the same node --- thanos/6-receiver.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/thanos/6-receiver.yaml b/thanos/6-receiver.yaml index 138edbf..a63698c 100644 --- a/thanos/6-receiver.yaml +++ b/thanos/6-receiver.yaml @@ -54,6 +54,18 @@ spec: serviceAccount: thanos securityContext: fsGroup: 1001 + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - receiver + topologyKey: kubernetes.io/hostname + weight: 1 initContainers: - name: init-chmod-data image: docker.io/bitnami/minideb:buster @@ -193,6 +205,18 @@ spec: serviceAccount: thanos securityContext: fsGroup: 1001 + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - receiver + topologyKey: kubernetes.io/hostname + weight: 1 initContainers: - name: init-chmod-data image: docker.io/bitnami/minideb:buster