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

podAntiAffinity matchExpressions wrong Key #225

Open
omnix-aecheverry opened this issue Apr 19, 2024 · 0 comments
Open

podAntiAffinity matchExpressions wrong Key #225

omnix-aecheverry opened this issue Apr 19, 2024 · 0 comments

Comments

@omnix-aecheverry
Copy link

I noticed that the pods were allocated on the same node. After investigating, I noticed that the key for matchExpressions should be 'name' instead of 'app' because the name of the app is 'my-mongodb-svc' not 'my-mongodb'. Even thought I also tried with 'my-mongodb-svc' and 'app', but it didn't work. When I changed the key to 'name', it worked because the replicaSet has the name 'my-mongodb'.

affinity:
  podAntiAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    - labelSelector:
        matchExpressions:
        - key: app #This should be **name** instead of app
          operator: In
          values:
          - my-mongodb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant