Skip to content

Commit

Permalink
deploy: relax Operator node affinity
Browse files Browse the repository at this point in the history
In the context of Hypershift (Hosted Clusters with OpenShift), where a Nodepool
(terminology for a worker Node in HCP) is not a control-plane or
a master Node but a worker, we can't force the Operator to be deployed
on a master node that doesn't exist. Instead, we want to deploy it on a
worker.

The proposal here is to relax the rule and use
`preferredDuringSchedulingIgnoredDuringExecution` instead so the scheduler
will try to find a master node or fallback on other nodes if not found.
  • Loading branch information
EmilienM committed Nov 14, 2024
1 parent 92fee7b commit a5147b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ spec:
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
# In the context of Hypershift, the SR-IOV network
# Operator is deployed on Nodepools which are labeled
# as workers. So we relax the node affinity to prefer
# masters/control-plane when possible otherwise we
# schedule where it's possible.
preferredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
Expand Down

0 comments on commit a5147b7

Please sign in to comment.