Skip to content

Commit

Permalink
Add podAntiAffinity labels to remaining HA control plane pods (#5409)
Browse files Browse the repository at this point in the history
Fixes: #5347

Add podAntiAffinity to eventing-controller, pingsource-mt-adapter and
sugar-controller pods
  • Loading branch information
lberk authored May 18, 2021
1 parent 62a75eb commit 0653ac4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
8 changes: 8 additions & 0 deletions config/channels/in-memory-channel/deployments/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ spec:
metadata:
labels: *labels
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels: *labels
topologyKey: kubernetes.io/hostname
weight: 100
serviceAccountName: imc-controller
enableServiceLinks: false
containers:
Expand Down
13 changes: 10 additions & 3 deletions config/core/deployments/pingsource-mt-adapter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,23 @@ spec:
# when set to 0 (and only 0) will be set to 1 when the first PingSource is created.
replicas: 0
selector:
matchLabels:
matchLabels: &labels
eventing.knative.dev/source: ping-source-controller
sources.knative.dev/role: adapter
template:
metadata:
labels:
eventing.knative.dev/source: ping-source-controller
sources.knative.dev/role: adapter
<<: *labels
eventing.knative.dev/release: devel
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels: *labels
topologyKey: kubernetes.io/hostname
weight: 100
enableServiceLinks: false
containers:
- name: dispatcher
Expand Down
8 changes: 8 additions & 0 deletions config/sugar/500-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ spec:
metadata:
labels: *labels
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels: *labels
topologyKey: kubernetes.io/hostname
weight: 100
serviceAccountName: eventing-controller
enableServiceLinks: false
containers:
Expand Down

0 comments on commit 0653ac4

Please sign in to comment.