Skip to content

Commit 48ddfa1

Browse files
committed
enforce anti affinity to separate similar pods
1 parent 8b29ae7 commit 48ddfa1

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

helm/templates/aiapi.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,9 @@ spec:
232232
operator: In
233233
values:
234234
- {{ $env }}
235-
podAntiAffinity: # try to avoid co-locating pods of the same app+color in the same node
236-
preferredDuringSchedulingIgnoredDuringExecution:
237-
- weight: 100
238-
podAffinityTerm:
235+
podAntiAffinity: # avoid co-locating pods of the same app+color in the same node
236+
requiredDuringSchedulingIgnoredDuringExecution:
237+
- podAffinityTerm:
239238
labelSelector:
240239
matchLabels:
241240
product: {{ $product }}

helm/templates/api.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,17 @@ spec:
175175
operator: In
176176
values:
177177
- {{ $env }}
178-
podAntiAffinity: # try to avoid co-locating pods of the same app+color in the same node
179-
preferredDuringSchedulingIgnoredDuringExecution:
180-
- weight: 100
181-
podAffinityTerm:
178+
podAntiAffinity: # avoid co-locating pods of the same app+color in the same node
179+
requiredDuringSchedulingIgnoredDuringExecution:
180+
- podAffinityTerm:
182181
labelSelector:
183182
matchLabels:
184183
product: {{ $product }}
185184
app: api
186185
color: {{ $color }}
187186
topologyKey: kubernetes.io/hostname
187+
188+
188189
containers:
189190
- name: api
190191
image: {{ $image.name }}:{{ $image.tag }}

helm/templates/webapp.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,9 @@ spec:
138138
operator: In
139139
values:
140140
- {{ $env }}
141-
podAntiAffinity: # try to avoid co-locating pods of the same app+color in the same node
142-
preferredDuringSchedulingIgnoredDuringExecution:
143-
- weight: 100
144-
podAffinityTerm:
141+
podAntiAffinity: # avoid co-locating pods of the same app+color in the same node
142+
requiredDuringSchedulingIgnoredDuringExecution:
143+
- podAffinityTerm:
145144
labelSelector:
146145
matchLabels:
147146
product: {{ $product }}

0 commit comments

Comments
 (0)