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

DaemonSet use node affinity not work #89476

Open
pytimer opened this issue Mar 25, 2020 · 3 comments
Open

DaemonSet use node affinity not work #89476

pytimer opened this issue Mar 25, 2020 · 3 comments

Comments

@pytimer
Copy link
Contributor

@pytimer pytimer commented Mar 25, 2020

What happened:

I create DaemonSet in the Kubernetes v1.17.2 cluster, i use NodeAffinity make pods only running on the node that have specified labels, but it not work. I get the pod information and the affinity have been override.

What you expected to happen:

DaemonSet node affinity works.

How to reproduce it (as minimally and precisely as possible):

  1. write a DaemonSet
  2. add node affinity like below:
affinity:
    nodeAffinity: 
        requiredDuringSchedulingIgnoredDuringExecution: 
        nodeSelectorTerms: 
        - matchExpressions: 
            - key: app
            operator: In
            values: 
            - fluent
  1. kubectl get pod -oyaml. The pod affinity become:
nodeAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
    - matchFields:
      - key: metadata.name
        operator: In
        values:
        - worker1

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):

v1.17.2

  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Network plugin and version (if this is a network-related bug):
  • Others:
@pytimer pytimer added the kind/bug label Mar 25, 2020
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Mar 25, 2020

@pytimer: There are no sig labels on this issue. Please add an appropriate label by using one of the following commands:

  • /sig <group-name>
  • /wg <group-name>
  • /committee <group-name>

Please see the group list for a listing of the SIGs, working groups, and committees available.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@wawa0210

This comment has been minimized.

Copy link
Contributor

@wawa0210 wawa0210 commented Mar 25, 2020

Can you provide the entire contents of your daemonset yaml? I just tested it and nodeAffinity works

@pytimer

This comment has been minimized.

Copy link
Contributor Author

@pytimer pytimer commented Mar 25, 2020

I run my daemonset in other cluster, it works. I check the cluster that went wrong, i found a mutate admission webhook add matchExpressions in pod NodeAffinity and have other application update the pod annotations after pod created, it maybe make nodeAffinity not work and have too many terminating pod in this namespace. I am not sure this problem because of admission webhook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.