Skip to content

Commit

Permalink
had to ensure app and lfmerge run on same node (#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
billy clark authored Aug 11, 2022
1 parent f089fe4 commit 27ed2f1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docker/deployment/app-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions docker/deployment/lfmerge-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27ed2f1

Please sign in to comment.