Open
Description
Bug description
The below configuration option doesn't do what one would expect and it seems like a bug.
singleuser:
extraNodeAffinity:
required:
- matchExpressions:
- key: "kubernetes.azure.com/scalesetpriority"
operator: NotIn
values: [spot]
scheduling:
userPods:
nodeAffinity:
matchNodePurpose: require
This generates 2 different match expressions as you can see below. If either of them match the pod is scheduled.
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.azure.com/scalesetpriority
operator: In
values:
- spot
- matchExpressions:
- key: hub.jupyter.org/node-purpose
operator: In
values:
- user
Naively I would expect this to generate a single match expression that is the union of the two like so:
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.azure.com/scalesetpriority
operator: In
values:
- spot
- key: hub.jupyter.org/node-purpose
operator: In
values:
- user
I'm running 3.0.2 on AKS 1.27.3.