Skip to content

cache_group 通过 nodeAffinity 进行节点选择不生效 #100

@404xlabs

Description

@404xlabs

问题描述

我想通过woker.template.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution来进行worker pod的节点选择

  enableScheduling: true
  worker:
    template:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/hostname
                operator: In
                values:
                - 70.0.10.122
                - 70.0.10.123

预期仅有两个worker被创建出来. 并且仅在70.0.10.122/70.0.10.123节点上,

但是发现在所有的节点上都创建了worker.

│ juicefs-cg-worker-c-70.0.10.113                                     ●   1/1    Running             0    6       6       6  248       24       24 70.0.10.113    70.0.10.113    26h       │
│ juicefs-cg-worker-c-70.0.10.122                                     ●   0/1    Pending             0    0       0       0    0        0        0 n/a            n/a            26h       │
│ juicefs-cg-worker-c-70.0.10.123                                     ●   1/1    Running             0    6       6       6  225       22       22 70.0.10.113    70.0.10.113    3m25s     │
│ juicefs-cg-worker-c-70.0.10.240                                     ●   1/1    Running             0    6       6       6  225       22       22 70.0.10.113    70.0.10.113    3m25s     │

并且pod被添加了 metadata.namematchFields

  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            - 70.0.10.122
            - 70.0.10.123
        - matchFields:
          - key: metadata.name
            operator: In
            values:
            - 70.0.10.240

请问这个是预期的么?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions