Red Hat Bugzilla – Bug 1462543
operator Gt, Lt are expected to support for pod affinity
Last modified: 2017-06-19 17:30:52 EDT
Description of problem:
operator Gt, Lt are expected to support for pod affinity.
docs says: operators for pod affinity and anti-affinity are In, NotIn, Exists, DoesNotExist, Gt, Lt
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. $ oc create -f pod-pod-affinity-gt-3.yaml
$ cat pod-pod-affinity-gt-3.yaml
- key: team
- name: pod-affinity
$ oc create -f pod-pod-affinity-gt-3.yaml
The Pod "pod-affinity-gt-3" is invalid: spec.affinity.podAffinity.requiredDuringSchedulingIgnoredDuringExecution.matchExpressions.matchExpressions.operator: Invalid value: "Gt": not a valid selector operator
if replace "Gt" with "Lt", same issue.
operators "In, NotIn, Exists, DoesNotExist" work as expected.
I had a discussion about it in todays's kube-sig-scheduler meeting and after discussion with David Oppenheimer@google, the conclusion was that the doc is incorrect about pod affinity/anti-affinity and they only honor regular label selector (In, NotIn, Exists, NotExists) but not Gt and Lt. Also, for node affinity/anti-affinity, it is true that they honor all label operators (In, NotIn, Exists, NotExists, Gt, Lt). So I will send a PR to fix the doc but the functonality is working as expected. I am closing this bug working as expected. Please reopen if you disagree.