Skip to content

Commit

Permalink
pod affinity: use required instead of preferred affinity for crawler …
Browse files Browse the repository at this point in the history
…pods
  • Loading branch information
ikreymer committed Nov 10, 2023
1 parent 6789299 commit 103fbb7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions chart/app-templates/crawler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,28 @@ spec:
claimName: {{ name }}

affinity:
{% if crawler_node_type %}
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: nodeType
operator: In
values:
- "{{ crawler_node_type }}"
{% endif %}

podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 2
- weight: 10
podAffinityTerm:
topologyKey: "failure-domain.beta.kubernetes.io/zone"
topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels:
crawl: {{ id }}
matchExpressions:
- key: crawl
operator: In
values:
- {{ id }}

tolerations:
- key: nodeType
Expand Down

0 comments on commit 103fbb7

Please sign in to comment.