Skip to content

Commit

Permalink
Add pod affinity for prometheus so it's scheduled on the same node wi…
Browse files Browse the repository at this point in the history
…th the Redis
  • Loading branch information
abystrov committed Dec 4, 2023
1 parent a2be5a6 commit 1279b78
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/monitoring/tmpl/prometheus/instance/ccp/prometheus.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ metadata:
{{- end }}
spec:
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 85
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{.Spec.Dbs.Redis.SvcName }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
Expand Down

0 comments on commit 1279b78

Please sign in to comment.