Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Affinity selectors use "AND" instead of "OR" logic #1635

Closed
ravindk89 opened this issue Jan 31, 2023 · 1 comment · Fixed by #1637
Closed

Node Affinity selectors use "AND" instead of "OR" logic #1635

ravindk89 opened this issue Jan 31, 2023 · 1 comment · Fixed by #1637
Assignees
Labels
bug Something isn't working

Comments

@ravindk89
Copy link
Contributor

Using latest stable Operator:

Attempted to apply node selectors as follows:

image

for node 2 -> 5

This results in the following YAML:

  pools:
  - affinity:
      nodeAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
          - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values:
              - node2
            - key: kubernetes.io/hostname
              operator: In
              values:
              - node3
            - key: kubernetes.io/hostname
              operator: In
              values:
              - node4
            - key: kubernetes.io/hostname
              operator: In
              values:
              - node5

This fails scheduling as Kubernetes appears to look for hostnames with all of those labels at once, not just any single one

The correct YAML via @pjuarezd is:

 pools:
  - affinity:
      nodeAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
          - matchExpressions:
            - key: kubernetes.io/hostname
              operator: In
              values:
              - node2
              - node3
              - node4
              - node5

I think the reasonable expectation here is to either:

  • Convert the selector field to be a manual entry or pickbox for "or" semantics, or
  • Treat the entire list like one giant "or"

The current functionality I think would not suffice for something like "restrict this tenant to the following node hostnames." It would work if you just applied a label I suppose.

@ravindk89 ravindk89 added the bug Something isn't working label Jan 31, 2023
@bexsoft bexsoft transferred this issue from minio/console Jun 12, 2023
@jiuker jiuker linked a pull request Jun 13, 2023 that will close this issue
@cniackz
Copy link
Contributor

cniackz commented Jun 14, 2023

Reproduced this issue, thanks for reporting it.
To reproduce this issue, you have to go into Pod Placement when creating a Tenant:

Screenshot 2023-06-14 at 8 48 57 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants