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

Adding nodeSelector option for PodSpec #19

Merged
merged 1 commit into from
Sep 21, 2020

Conversation

aignatov
Copy link
Contributor

No description provided.

@shamil
Copy link

shamil commented May 20, 2020

@aignatov not sure this is needed, there is already Affinity in the spec that can do that

@aignatov
Copy link
Contributor Author

@aignatov not sure this is needed, there is already Affinity in the spec that can do that

@shamil thanks for your reply. My use case is as follows:

  • My redis pods has to be scheduled only to specific nodes with specific labels
  • I also use anitiAffininty option not to collocate two pods with similar labels

Unfortunately I didn't find better way how to organize such deployment w/o nodeSelector option.

@shamil
Copy link

shamil commented May 20, 2020

I've similar requirement, this is what I put in affinity block

affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: dedicated
          operator: In
          values: ['redis']
  podAntiAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    - labelSelector:
        matchLabels:
          app.kubernetes.io/instance: tokens
          app.kubernetes.io/name: redis
      topologyKey: kubernetes.io/hostname

@aignatov
Copy link
Contributor Author

@shamil you're right, it's possible to do so but I'm worried about performance of old k8s clusters with several hundreds of nodes. Here is a opened discussion about it:
kubernetes/kubernetes#72479

Also nodeSelector looks like straightforward option (just like clear node filtering by labels) for other cases which may not requiring complex affinity rules. I mean why not have this option if k8s allows it. :)

@toha10
Copy link
Contributor

toha10 commented May 20, 2020

LGTM

@toha10
Copy link
Contributor

toha10 commented Sep 20, 2020

@nrvnrvn or somebody with permissions on merge, please take a look

@nrvnrvn nrvnrvn merged commit 9565a0a into amaizfinance:master Sep 21, 2020
@nrvnrvn
Copy link
Collaborator

nrvnrvn commented Sep 21, 2020

@aignatov thanks for the contribution
@toha10 thanks for the heads up ;)

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

Successfully merging this pull request may close these issues.

4 participants