From 27ed2f13c71d325b53fc213d483274ac65b0d133 Mon Sep 17 00:00:00 2001 From: billy clark Date: Thu, 11 Aug 2022 08:50:45 -0400 Subject: [PATCH] had to ensure app and lfmerge run on same node (#1434) --- docker/deployment/app-deployment.yaml | 17 +++++++++++++++++ docker/deployment/lfmerge-deployment.yaml | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/docker/deployment/app-deployment.yaml b/docker/deployment/app-deployment.yaml index cf3fc1b058..7f35272c5a 100644 --- a/docker/deployment/app-deployment.yaml +++ b/docker/deployment/app-deployment.yaml @@ -65,6 +65,23 @@ spec: labels: app: app spec: + affinity: + # required to ensure this container makes it to lfmerge's dedicated node + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: dedicated + operator: In + values: + - lfmerge + weight: 1 + # required to ensure this container makes it to lfmerge's dedicated node + tolerations: + - effect: NoSchedule + key: dedicated + operator: Equal + value: lfmerge volumes: - name: assets persistentVolumeClaim: diff --git a/docker/deployment/lfmerge-deployment.yaml b/docker/deployment/lfmerge-deployment.yaml index 67158bef85..a473137cb9 100644 --- a/docker/deployment/lfmerge-deployment.yaml +++ b/docker/deployment/lfmerge-deployment.yaml @@ -76,6 +76,16 @@ spec: values: - lfmerge weight: 1 + # need to keep this on the same pod as the app since inotify only gets notification when updates occur on the same kernel + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - app + topologyKey: kubernetes.io/hostname # required to ensure this container makes it to a dedicated node (so it doesn't crash other containers when it blows up) tolerations: - effect: NoSchedule