apiVersion: v1
kind: Pod
metadata:
  name: with-node-affinity
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: <host key for particular node>
            operator: In
            values:
            - <host key value for particular node>
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 1
        preference:
          matchExpressions:
          - key: <host key for particular node>
            operator: In
            values:
            - <host key value for particular node>
  containers:
  - name: with-node-affinity
    image: nginx