Node Affinity Example

spec:
  affinity:
    nodeAffinity: 
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 1
        preference:
          matchExpressions:
          - key: diskspeed
            operator: In
            values:
            - quick
            - fast

The nodeAffinity prefers a node with the above rule, but the pod would be scheduled even if there were no matching nodes. The rule gives extra weight to nodes with a key of diskspeed with a value of fast or quick.

Last updated